(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.richTextPreview = factory());
})(this, (function () { 'use strict';

  function styleInject(css, ref) {
    if ( ref === void 0 ) ref = {};
    var insertAt = ref.insertAt;

    if (!css || typeof document === 'undefined') { return; }

    var head = document.head || document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    style.type = 'text/css';

    if (insertAt === 'top') {
      if (head.firstChild) {
        head.insertBefore(style, head.firstChild);
      } else {
        head.appendChild(style);
      }
    } else {
      head.appendChild(style);
    }

    if (style.styleSheet) {
      style.styleSheet.cssText = css;
    } else {
      style.appendChild(document.createTextNode(css));
    }
  }

  var css_248z = "/*!\n * Viewer.js v1.11.0\n * https://fengyuanchen.github.io/viewerjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2022-10-16T06:41:23.145Z\n */\n\n.viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {\n    background-image: url(\"\");\n    background-repeat: no-repeat;\n    background-size: 280px;\n    color: transparent;\n    display: block;\n    font-size: 0;\n    height: 20px;\n    line-height: 0;\n    width: 20px;\n  }\n\n.viewer-zoom-in::before {\n  background-position: 0 0;\n  content: \"Zoom In\";\n}\n\n.viewer-zoom-out::before {\n  background-position: -20px 0;\n  content: \"Zoom Out\";\n}\n\n.viewer-one-to-one::before {\n  background-position: -40px 0;\n  content: \"One to One\";\n}\n\n.viewer-reset::before {\n  background-position: -60px 0;\n  content: \"Reset\";\n}\n\n.viewer-prev::before {\n  background-position: -80px 0;\n  content: \"Previous\";\n}\n\n.viewer-play::before {\n  background-position: -100px 0;\n  content: \"Play\";\n}\n\n.viewer-next::before {\n  background-position: -120px 0;\n  content: \"Next\";\n}\n\n.viewer-rotate-left::before {\n  background-position: -140px 0;\n  content: \"Rotate Left\";\n}\n\n.viewer-rotate-right::before {\n  background-position: -160px 0;\n  content: \"Rotate Right\";\n}\n\n.viewer-flip-horizontal::before {\n  background-position: -180px 0;\n  content: \"Flip Horizontal\";\n}\n\n.viewer-flip-vertical::before {\n  background-position: -200px 0;\n  content: \"Flip Vertical\";\n}\n\n.viewer-fullscreen::before {\n  background-position: -220px 0;\n  content: \"Enter Full Screen\";\n}\n\n.viewer-fullscreen-exit::before {\n  background-position: -240px 0;\n  content: \"Exit Full Screen\";\n}\n\n.viewer-close::before {\n  background-position: -260px 0;\n  content: \"Close\";\n}\n\n.viewer-container {\n  bottom: 0;\n  direction: ltr;\n  font-size: 0;\n  left: 0;\n  line-height: 0;\n  overflow: hidden;\n  position: absolute;\n  right: 0;\n  -webkit-tap-highlight-color: transparent;\n  top: 0;\n  -ms-touch-action: none;\n      touch-action: none;\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n     -moz-user-select: none;\n      -ms-user-select: none;\n          user-select: none;\n}\n\n.viewer-container::-moz-selection, .viewer-container *::-moz-selection {\n    background-color: transparent;\n  }\n\n.viewer-container::selection,\n  .viewer-container *::selection {\n    background-color: transparent;\n  }\n\n.viewer-container:focus {\n    outline: 0;\n  }\n\n.viewer-container img {\n    display: block;\n    height: auto;\n    max-height: none !important;\n    max-width: none !important;\n    min-height: 0 !important;\n    min-width: 0 !important;\n    width: 100%;\n  }\n\n.viewer-canvas {\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.viewer-canvas > img {\n    height: auto;\n    margin: 15px auto;\n    max-width: 90% !important;\n    width: auto;\n  }\n\n.viewer-footer {\n  bottom: 0;\n  left: 0;\n  overflow: hidden;\n  position: absolute;\n  right: 0;\n  text-align: center;\n}\n\n.viewer-navbar {\n  background-color: rgba(0, 0, 0, 50%);\n  overflow: hidden;\n}\n\n.viewer-list {\n  box-sizing: content-box;\n  height: 50px;\n  margin: 0;\n  overflow: hidden;\n  padding: 1px 0;\n}\n\n.viewer-list > li {\n    color: transparent;\n    cursor: pointer;\n    float: left;\n    font-size: 0;\n    height: 50px;\n    line-height: 0;\n    opacity: 0.5;\n    overflow: hidden;\n    transition: opacity 0.15s;\n    width: 30px;\n  }\n\n.viewer-list > li:focus,\n    .viewer-list > li:hover {\n      opacity: 0.75;\n    }\n\n.viewer-list > li:focus {\n      outline: 0;\n    }\n\n.viewer-list > li + li {\n      margin-left: 1px;\n    }\n\n.viewer-list > .viewer-loading {\n    position: relative;\n  }\n\n.viewer-list > .viewer-loading::after {\n      border-width: 2px;\n      height: 20px;\n      margin-left: -10px;\n      margin-top: -10px;\n      width: 20px;\n    }\n\n.viewer-list > .viewer-active,\n  .viewer-list > .viewer-active:focus,\n  .viewer-list > .viewer-active:hover {\n    opacity: 1;\n  }\n\n.viewer-player {\n  background-color: #000;\n  bottom: 0;\n  cursor: none;\n  display: none;\n  left: 0;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: 1;\n}\n\n.viewer-player > img {\n    left: 0;\n    position: absolute;\n    top: 0;\n  }\n\n.viewer-toolbar > ul {\n    display: inline-block;\n    margin: 0 auto 5px;\n    overflow: hidden;\n    padding: 6px 3px;\n  }\n\n.viewer-toolbar > ul > li {\n      background-color: rgba(0, 0, 0, 50%);\n      border-radius: 50%;\n      cursor: pointer;\n      float: left;\n      height: 24px;\n      overflow: hidden;\n      transition: background-color 0.15s;\n      width: 24px;\n    }\n\n.viewer-toolbar > ul > li:focus,\n      .viewer-toolbar > ul > li:hover {\n        background-color: rgba(0, 0, 0, 80%);\n      }\n\n.viewer-toolbar > ul > li:focus {\n        box-shadow: 0 0 3px #fff;\n        outline: 0;\n        position: relative;\n        z-index: 1;\n      }\n\n.viewer-toolbar > ul > li::before {\n        margin: 2px;\n      }\n\n.viewer-toolbar > ul > li + li {\n        margin-left: 1px;\n      }\n\n.viewer-toolbar > ul > .viewer-small {\n      height: 18px;\n      margin-bottom: 3px;\n      margin-top: 3px;\n      width: 18px;\n    }\n\n.viewer-toolbar > ul > .viewer-small::before {\n        margin: -1px;\n      }\n\n.viewer-toolbar > ul > .viewer-large {\n      height: 30px;\n      margin-bottom: -3px;\n      margin-top: -3px;\n      width: 30px;\n    }\n\n.viewer-toolbar > ul > .viewer-large::before {\n        margin: 5px;\n      }\n\n.viewer-tooltip {\n  background-color: rgba(0, 0, 0, 80%);\n  border-radius: 10px;\n  color: #fff;\n  display: none;\n  font-size: 12px;\n  height: 20px;\n  left: 50%;\n  line-height: 20px;\n  margin-left: -25px;\n  margin-top: -10px;\n  position: absolute;\n  text-align: center;\n  top: 50%;\n  width: 50px;\n}\n\n.viewer-title {\n  color: #ccc;\n  display: inline-block;\n  font-size: 12px;\n  line-height: 1.2;\n  margin: 5px 5%;\n  max-width: 90%;\n  min-height: 14px;\n  opacity: 0.8;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  transition: opacity 0.15s;\n  white-space: nowrap;\n}\n\n.viewer-title:hover {\n    opacity: 1;\n  }\n\n.viewer-button {\n  -webkit-app-region: no-drag;\n  background-color: rgba(0, 0, 0, 50%);\n  border-radius: 50%;\n  cursor: pointer;\n  height: 80px;\n  overflow: hidden;\n  position: absolute;\n  right: -40px;\n  top: -40px;\n  transition: background-color 0.15s;\n  width: 80px;\n}\n\n.viewer-button:focus,\n  .viewer-button:hover {\n    background-color: rgba(0, 0, 0, 80%);\n  }\n\n.viewer-button:focus {\n    box-shadow: 0 0 3px #fff;\n    outline: 0;\n  }\n\n.viewer-button::before {\n    bottom: 15px;\n    left: 15px;\n    position: absolute;\n  }\n\n.viewer-fixed {\n  position: fixed;\n}\n\n.viewer-open {\n  overflow: hidden;\n}\n\n.viewer-show {\n  display: block;\n}\n\n.viewer-hide {\n  display: none;\n}\n\n.viewer-backdrop {\n  background-color: rgba(0, 0, 0, 50%);\n}\n\n.viewer-invisible {\n  visibility: hidden;\n}\n\n.viewer-move {\n  cursor: move;\n  cursor: grab;\n}\n\n.viewer-fade {\n  opacity: 0;\n}\n\n.viewer-in {\n  opacity: 1;\n}\n\n.viewer-transition {\n  transition: all 0.3s;\n}\n\n@keyframes viewer-spinner {\n  0% {\n    transform: rotate(0deg);\n  }\n\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.viewer-loading::after {\n    animation: viewer-spinner 1s linear infinite;\n    border: 4px solid rgba(255, 255, 255, 10%);\n    border-left-color: rgba(255, 255, 255, 50%);\n    border-radius: 50%;\n    content: \"\";\n    display: inline-block;\n    height: 40px;\n    left: 50%;\n    margin-left: -20px;\n    margin-top: -20px;\n    position: absolute;\n    top: 50%;\n    width: 40px;\n    z-index: 1;\n  }\n\n@media (max-width: 767px) {\n  .viewer-hide-xs-down {\n    display: none;\n  }\n}\n\n@media (max-width: 991px) {\n  .viewer-hide-sm-down {\n    display: none;\n  }\n}\n\n@media (max-width: 1199px) {\n  .viewer-hide-md-down {\n    display: none;\n  }\n}\n";
  styleInject(css_248z);

  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

  function getAugmentedNamespace(n) {
    var f = n.default;
  	if (typeof f == "function") {
  		var a = function () {
  			return f.apply(this, arguments);
  		};
  		a.prototype = f.prototype;
    } else a = {};
    Object.defineProperty(a, '__esModule', {value: true});
  	Object.keys(n).forEach(function (k) {
  		var d = Object.getOwnPropertyDescriptor(n, k);
  		Object.defineProperty(a, k, d.get ? d : {
  			enumerable: true,
  			get: function () {
  				return n[k];
  			}
  		});
  	});
  	return a;
  }

  var vViewer = {exports: {}};

  /*!
   * Viewer.js v1.11.0
   * https://fengyuanchen.github.io/viewerjs
   *
   * Copyright 2015-present Chen Fengyuan
   * Released under the MIT license
   *
   * Date: 2022-10-16T06:41:28.706Z
   */

  function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function (sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
    return keys;
  }
  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
        _defineProperty(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
    return target;
  }
  function _typeof(obj) {
    "@babel/helpers - typeof";

    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
      return typeof obj;
    } : function (obj) {
      return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    }, _typeof(obj);
  }
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", {
      writable: false
    });
    return Constructor;
  }
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
    return obj;
  }

  var DEFAULTS = {
    /**
     * Enable a modal backdrop, specify `static` for a backdrop
     * which doesn't close the modal on click.
     * @type {boolean}
     */
    backdrop: true,
    /**
     * Show the button on the top-right of the viewer.
     * @type {boolean}
     */
    button: true,
    /**
     * Show the navbar.
     * @type {boolean | number}
     */
    navbar: true,
    /**
     * Specify the visibility and the content of the title.
     * @type {boolean | number | Function | Array}
     */
    title: true,
    /**
     * Show the toolbar.
     * @type {boolean | number | Object}
     */
    toolbar: true,
    /**
     * Custom class name(s) to add to the viewer's root element.
     * @type {string}
     */
    className: '',
    /**
     * Define where to put the viewer in modal mode.
     * @type {string | Element}
     */
    container: 'body',
    /**
     * Filter the images for viewing. Return true if the image is viewable.
     * @type {Function}
     */
    filter: null,
    /**
     * Enable to request fullscreen when play.
     * {@link https://developer.mozilla.org/en-US/docs/Web/API/FullscreenOptions}
     * @type {boolean|FullscreenOptions}
     */
    fullscreen: true,
    /**
     * Define the extra attributes to inherit from the original image.
     * @type {Array}
     */
    inheritedAttributes: ['crossOrigin', 'decoding', 'isMap', 'loading', 'referrerPolicy', 'sizes', 'srcset', 'useMap'],
    /**
     * Define the initial coverage of the viewing image.
     * @type {number}
     */
    initialCoverage: 0.9,
    /**
     * Define the initial index of the image for viewing.
     * @type {number}
     */
    initialViewIndex: 0,
    /**
     * Enable inline mode.
     * @type {boolean}
     */
    inline: false,
    /**
     * The amount of time to delay between automatically cycling an image when playing.
     * @type {number}
     */
    interval: 5000,
    /**
     * Enable keyboard support.
     * @type {boolean}
     */
    keyboard: true,
    /**
     * Focus the viewer when initialized.
     * @type {boolean}
     */
    focus: true,
    /**
     * Indicate if show a loading spinner when load image or not.
     * @type {boolean}
     */
    loading: true,
    /**
     * Indicate if enable loop viewing or not.
     * @type {boolean}
     */
    loop: true,
    /**
     * Min width of the viewer in inline mode.
     * @type {number}
     */
    minWidth: 200,
    /**
     * Min height of the viewer in inline mode.
     * @type {number}
     */
    minHeight: 100,
    /**
     * Enable to move the image.
     * @type {boolean}
     */
    movable: true,
    /**
     * Enable to rotate the image.
     * @type {boolean}
     */
    rotatable: true,
    /**
     * Enable to scale the image.
     * @type {boolean}
     */
    scalable: true,
    /**
     * Enable to zoom the image.
     * @type {boolean}
     */
    zoomable: true,
    /**
     * Enable to zoom the current image by dragging on the touch screen.
     * @type {boolean}
     */
    zoomOnTouch: true,
    /**
     * Enable to zoom the image by wheeling mouse.
     * @type {boolean}
     */
    zoomOnWheel: true,
    /**
     * Enable to slide to the next or previous image by swiping on the touch screen.
     * @type {boolean}
     */
    slideOnTouch: true,
    /**
     * Indicate if toggle the image size between its natural size
     * and initial size when double click on the image or not.
     * @type {boolean}
     */
    toggleOnDblclick: true,
    /**
     * Show the tooltip with image ratio (percentage) when zoom in or zoom out.
     * @type {boolean}
     */
    tooltip: true,
    /**
     * Enable CSS3 Transition for some special elements.
     * @type {boolean}
     */
    transition: true,
    /**
     * Define the CSS `z-index` value of viewer in modal mode.
     * @type {number}
     */
    zIndex: 2015,
    /**
     * Define the CSS `z-index` value of viewer in inline mode.
     * @type {number}
     */
    zIndexInline: 0,
    /**
     * Define the ratio when zoom the image by wheeling mouse.
     * @type {number}
     */
    zoomRatio: 0.1,
    /**
     * Define the min ratio of the image when zoom out.
     * @type {number}
     */
    minZoomRatio: 0.01,
    /**
     * Define the max ratio of the image when zoom in.
     * @type {number}
     */
    maxZoomRatio: 100,
    /**
     * Define where to get the original image URL for viewing.
     * @type {string | Function}
     */
    url: 'src',
    /**
     * Event shortcuts.
     * @type {Function}
     */
    ready: null,
    show: null,
    shown: null,
    hide: null,
    hidden: null,
    view: null,
    viewed: null,
    move: null,
    moved: null,
    rotate: null,
    rotated: null,
    scale: null,
    scaled: null,
    zoom: null,
    zoomed: null,
    play: null,
    stop: null
  };

  var TEMPLATE = '<div class="viewer-container" tabindex="-1" touch-action="none">' + '<div class="viewer-canvas"></div>' + '<div class="viewer-footer">' + '<div class="viewer-title"></div>' + '<div class="viewer-toolbar"></div>' + '<div class="viewer-navbar">' + '<ul class="viewer-list" role="navigation"></ul>' + '</div>' + '</div>' + '<div class="viewer-tooltip" role="alert" aria-hidden="true"></div>' + '<div class="viewer-button" data-viewer-action="mix" role="button"></div>' + '<div class="viewer-player"></div>' + '</div>';

  var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
  var WINDOW = IS_BROWSER ? window : {};
  var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false;
  var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
  var NAMESPACE = 'viewer';

  // Actions
  var ACTION_MOVE = 'move';
  var ACTION_SWITCH = 'switch';
  var ACTION_ZOOM = 'zoom';

  // Classes
  var CLASS_ACTIVE = "".concat(NAMESPACE, "-active");
  var CLASS_CLOSE = "".concat(NAMESPACE, "-close");
  var CLASS_FADE = "".concat(NAMESPACE, "-fade");
  var CLASS_FIXED = "".concat(NAMESPACE, "-fixed");
  var CLASS_FULLSCREEN = "".concat(NAMESPACE, "-fullscreen");
  var CLASS_FULLSCREEN_EXIT = "".concat(NAMESPACE, "-fullscreen-exit");
  var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
  var CLASS_HIDE_MD_DOWN = "".concat(NAMESPACE, "-hide-md-down");
  var CLASS_HIDE_SM_DOWN = "".concat(NAMESPACE, "-hide-sm-down");
  var CLASS_HIDE_XS_DOWN = "".concat(NAMESPACE, "-hide-xs-down");
  var CLASS_IN = "".concat(NAMESPACE, "-in");
  var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
  var CLASS_LOADING = "".concat(NAMESPACE, "-loading");
  var CLASS_MOVE = "".concat(NAMESPACE, "-move");
  var CLASS_OPEN = "".concat(NAMESPACE, "-open");
  var CLASS_SHOW = "".concat(NAMESPACE, "-show");
  var CLASS_TRANSITION = "".concat(NAMESPACE, "-transition");

  // Native events
  var EVENT_CLICK = 'click';
  var EVENT_DBLCLICK = 'dblclick';
  var EVENT_DRAG_START = 'dragstart';
  var EVENT_FOCUSIN = 'focusin';
  var EVENT_KEY_DOWN = 'keydown';
  var EVENT_LOAD = 'load';
  var EVENT_ERROR = 'error';
  var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
  var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
  var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
  var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
  var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
  var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
  var EVENT_RESIZE = 'resize';
  var EVENT_TRANSITION_END = 'transitionend';
  var EVENT_WHEEL = 'wheel';

  // Custom events
  var EVENT_READY = 'ready';
  var EVENT_SHOW = 'show';
  var EVENT_SHOWN = 'shown';
  var EVENT_HIDE = 'hide';
  var EVENT_HIDDEN = 'hidden';
  var EVENT_VIEW = 'view';
  var EVENT_VIEWED = 'viewed';
  var EVENT_MOVE = 'move';
  var EVENT_MOVED = 'moved';
  var EVENT_ROTATE = 'rotate';
  var EVENT_ROTATED = 'rotated';
  var EVENT_SCALE = 'scale';
  var EVENT_SCALED = 'scaled';
  var EVENT_ZOOM = 'zoom';
  var EVENT_ZOOMED = 'zoomed';
  var EVENT_PLAY = 'play';
  var EVENT_STOP = 'stop';

  // Data keys
  var DATA_ACTION = "".concat(NAMESPACE, "Action");

  // RegExps
  var REGEXP_SPACES = /\s\s*/;

  // Misc
  var BUTTONS = ['zoom-in', 'zoom-out', 'one-to-one', 'reset', 'prev', 'play', 'next', 'rotate-left', 'rotate-right', 'flip-horizontal', 'flip-vertical'];

  /**
   * Check if the given value is a string.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is a string, else `false`.
   */
  function isString(value) {
    return typeof value === 'string';
  }

  /**
   * Check if the given value is not a number.
   */
  var isNaN$1 = Number.isNaN || WINDOW.isNaN;

  /**
   * Check if the given value is a number.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is a number, else `false`.
   */
  function isNumber(value) {
    return typeof value === 'number' && !isNaN$1(value);
  }

  /**
   * Check if the given value is undefined.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
   */
  function isUndefined(value) {
    return typeof value === 'undefined';
  }

  /**
   * Check if the given value is an object.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is an object, else `false`.
   */
  function isObject(value) {
    return _typeof(value) === 'object' && value !== null;
  }
  var hasOwnProperty = Object.prototype.hasOwnProperty;

  /**
   * Check if the given value is a plain object.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
   */
  function isPlainObject(value) {
    if (!isObject(value)) {
      return false;
    }
    try {
      var _constructor = value.constructor;
      var prototype = _constructor.prototype;
      return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
    } catch (error) {
      return false;
    }
  }

  /**
   * Check if the given value is a function.
   * @param {*} value - The value to check.
   * @returns {boolean} Returns `true` if the given value is a function, else `false`.
   */
  function isFunction(value) {
    return typeof value === 'function';
  }

  /**
   * Iterate the given data.
   * @param {*} data - The data to iterate.
   * @param {Function} callback - The process function for each element.
   * @returns {*} The original data.
   */
  function forEach(data, callback) {
    if (data && isFunction(callback)) {
      if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
        var length = data.length;
        var i;
        for (i = 0; i < length; i += 1) {
          if (callback.call(data, data[i], i, data) === false) {
            break;
          }
        }
      } else if (isObject(data)) {
        Object.keys(data).forEach(function (key) {
          callback.call(data, data[key], key, data);
        });
      }
    }
    return data;
  }

  /**
   * Extend the given object.
   * @param {*} obj - The object to be extended.
   * @param {*} args - The rest objects which will be merged to the first object.
   * @returns {Object} The extended object.
   */
  var assign = Object.assign || function assign(obj) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    if (isObject(obj) && args.length > 0) {
      args.forEach(function (arg) {
        if (isObject(arg)) {
          Object.keys(arg).forEach(function (key) {
            obj[key] = arg[key];
          });
        }
      });
    }
    return obj;
  };
  var REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/;

  /**
   * Apply styles to the given element.
   * @param {Element} element - The target element.
   * @param {Object} styles - The styles for applying.
   */
  function setStyle(element, styles) {
    var style = element.style;
    forEach(styles, function (value, property) {
      if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
        value += 'px';
      }
      style[property] = value;
    });
  }

  /**
   * Escape a string for using in HTML.
   * @param {String} value - The string to escape.
   * @returns {String} Returns the escaped string.
   */
  function escapeHTMLEntities(value) {
    return isString(value) ? value.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;') : value;
  }

  /**
   * Check if the given element has a special class.
   * @param {Element} element - The element to check.
   * @param {string} value - The class to search.
   * @returns {boolean} Returns `true` if the special class was found.
   */
  function hasClass(element, value) {
    if (!element || !value) {
      return false;
    }
    return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
  }

  /**
   * Add classes to the given element.
   * @param {Element} element - The target element.
   * @param {string} value - The classes to be added.
   */
  function addClass(element, value) {
    if (!element || !value) {
      return;
    }
    if (isNumber(element.length)) {
      forEach(element, function (elem) {
        addClass(elem, value);
      });
      return;
    }
    if (element.classList) {
      element.classList.add(value);
      return;
    }
    var className = element.className.trim();
    if (!className) {
      element.className = value;
    } else if (className.indexOf(value) < 0) {
      element.className = "".concat(className, " ").concat(value);
    }
  }

  /**
   * Remove classes from the given element.
   * @param {Element} element - The target element.
   * @param {string} value - The classes to be removed.
   */
  function removeClass(element, value) {
    if (!element || !value) {
      return;
    }
    if (isNumber(element.length)) {
      forEach(element, function (elem) {
        removeClass(elem, value);
      });
      return;
    }
    if (element.classList) {
      element.classList.remove(value);
      return;
    }
    if (element.className.indexOf(value) >= 0) {
      element.className = element.className.replace(value, '');
    }
  }

  /**
   * Add or remove classes from the given element.
   * @param {Element} element - The target element.
   * @param {string} value - The classes to be toggled.
   * @param {boolean} added - Add only.
   */
  function toggleClass(element, value, added) {
    if (!value) {
      return;
    }
    if (isNumber(element.length)) {
      forEach(element, function (elem) {
        toggleClass(elem, value, added);
      });
      return;
    }

    // IE10-11 doesn't support the second parameter of `classList.toggle`
    if (added) {
      addClass(element, value);
    } else {
      removeClass(element, value);
    }
  }
  var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;

  /**
   * Transform the given string from camelCase to kebab-case
   * @param {string} value - The value to transform.
   * @returns {string} The transformed value.
   */
  function hyphenate(value) {
    return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
  }

  /**
   * Get data from the given element.
   * @param {Element} element - The target element.
   * @param {string} name - The data key to get.
   * @returns {string} The data value.
   */
  function getData(element, name) {
    if (isObject(element[name])) {
      return element[name];
    }
    if (element.dataset) {
      return element.dataset[name];
    }
    return element.getAttribute("data-".concat(hyphenate(name)));
  }

  /**
   * Set data to the given element.
   * @param {Element} element - The target element.
   * @param {string} name - The data key to set.
   * @param {string} data - The data value.
   */
  function setData(element, name, data) {
    if (isObject(data)) {
      element[name] = data;
    } else if (element.dataset) {
      element.dataset[name] = data;
    } else {
      element.setAttribute("data-".concat(hyphenate(name)), data);
    }
  }
  var onceSupported = function () {
    var supported = false;
    if (IS_BROWSER) {
      var once = false;
      var listener = function listener() {};
      var options = Object.defineProperty({}, 'once', {
        get: function get() {
          supported = true;
          return once;
        },
        /**
         * This setter can fix a `TypeError` in strict mode
         * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
         * @param {boolean} value - The value to set
         */set: function set(value) {
          once = value;
        }
      });
      WINDOW.addEventListener('test', listener, options);
      WINDOW.removeEventListener('test', listener, options);
    }
    return supported;
  }();

  /**
   * Remove event listener from the target element.
   * @param {Element} element - The event target.
   * @param {string} type - The event type(s).
   * @param {Function} listener - The event listener.
   * @param {Object} options - The event options.
   */
  function removeListener(element, type, listener) {
    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
    var handler = listener;
    type.trim().split(REGEXP_SPACES).forEach(function (event) {
      if (!onceSupported) {
        var listeners = element.listeners;
        if (listeners && listeners[event] && listeners[event][listener]) {
          handler = listeners[event][listener];
          delete listeners[event][listener];
          if (Object.keys(listeners[event]).length === 0) {
            delete listeners[event];
          }
          if (Object.keys(listeners).length === 0) {
            delete element.listeners;
          }
        }
      }
      element.removeEventListener(event, handler, options);
    });
  }

  /**
   * Add event listener to the target element.
   * @param {Element} element - The event target.
   * @param {string} type - The event type(s).
   * @param {Function} listener - The event listener.
   * @param {Object} options - The event options.
   */
  function addListener(element, type, listener) {
    var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
    var _handler = listener;
    type.trim().split(REGEXP_SPACES).forEach(function (event) {
      if (options.once && !onceSupported) {
        var _element$listeners = element.listeners,
          listeners = _element$listeners === void 0 ? {} : _element$listeners;
        _handler = function handler() {
          delete listeners[event][listener];
          element.removeEventListener(event, _handler, options);
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
          listener.apply(element, args);
        };
        if (!listeners[event]) {
          listeners[event] = {};
        }
        if (listeners[event][listener]) {
          element.removeEventListener(event, listeners[event][listener], options);
        }
        listeners[event][listener] = _handler;
        element.listeners = listeners;
      }
      element.addEventListener(event, _handler, options);
    });
  }

  /**
   * Dispatch event on the target element.
   * @param {Element} element - The event target.
   * @param {string} type - The event type(s).
   * @param {Object} data - The additional event data.
   * @param {Object} options - The additional event options.
   * @returns {boolean} Indicate if the event is default prevented or not.
   */
  function dispatchEvent(element, type, data, options) {
    var event;

    // Event and CustomEvent on IE9-11 are global objects, not constructors
    if (isFunction(Event) && isFunction(CustomEvent)) {
      event = new CustomEvent(type, _objectSpread2({
        bubbles: true,
        cancelable: true,
        detail: data
      }, options));
    } else {
      event = document.createEvent('CustomEvent');
      event.initCustomEvent(type, true, true, data);
    }
    return element.dispatchEvent(event);
  }

  /**
   * Get the offset base on the document.
   * @param {Element} element - The target element.
   * @returns {Object} The offset data.
   */
  function getOffset(element) {
    var box = element.getBoundingClientRect();
    return {
      left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
      top: box.top + (window.pageYOffset - document.documentElement.clientTop)
    };
  }

  /**
   * Get transforms base on the given object.
   * @param {Object} obj - The target object.
   * @returns {string} A string contains transform values.
   */
  function getTransforms(_ref) {
    var rotate = _ref.rotate,
      scaleX = _ref.scaleX,
      scaleY = _ref.scaleY,
      translateX = _ref.translateX,
      translateY = _ref.translateY;
    var values = [];
    if (isNumber(translateX) && translateX !== 0) {
      values.push("translateX(".concat(translateX, "px)"));
    }
    if (isNumber(translateY) && translateY !== 0) {
      values.push("translateY(".concat(translateY, "px)"));
    }

    // Rotate should come first before scale to match orientation transform
    if (isNumber(rotate) && rotate !== 0) {
      values.push("rotate(".concat(rotate, "deg)"));
    }
    if (isNumber(scaleX) && scaleX !== 1) {
      values.push("scaleX(".concat(scaleX, ")"));
    }
    if (isNumber(scaleY) && scaleY !== 1) {
      values.push("scaleY(".concat(scaleY, ")"));
    }
    var transform = values.length ? values.join(' ') : 'none';
    return {
      WebkitTransform: transform,
      msTransform: transform,
      transform: transform
    };
  }

  /**
   * Get an image name from an image url.
   * @param {string} url - The target url.
   * @example
   * // picture.jpg
   * getImageNameFromURL('https://domain.com/path/to/picture.jpg?size=1280×960')
   * @returns {string} A string contains the image name.
   */
  function getImageNameFromURL(url) {
    return isString(url) ? decodeURIComponent(url.replace(/^.*\//, '').replace(/[?&#].*$/, '')) : '';
  }
  var IS_SAFARI = WINDOW.navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(WINDOW.navigator.userAgent);

  /**
   * Get an image's natural sizes.
   * @param {string} image - The target image.
   * @param {Object} options - The viewer options.
   * @param {Function} callback - The callback function.
   * @returns {HTMLImageElement} The new image.
   */
  function getImageNaturalSizes(image, options, callback) {
    var newImage = document.createElement('img');

    // Modern browsers (except Safari)
    if (image.naturalWidth && !IS_SAFARI) {
      callback(image.naturalWidth, image.naturalHeight);
      return newImage;
    }
    var body = document.body || document.documentElement;
    newImage.onload = function () {
      callback(newImage.width, newImage.height);
      if (!IS_SAFARI) {
        body.removeChild(newImage);
      }
    };
    forEach(options.inheritedAttributes, function (name) {
      var value = image.getAttribute(name);
      if (value !== null) {
        newImage.setAttribute(name, value);
      }
    });
    newImage.src = image.src;

    // iOS Safari will convert the image automatically
    // with its orientation once append it into DOM
    if (!IS_SAFARI) {
      newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
      body.appendChild(newImage);
    }
    return newImage;
  }

  /**
   * Get the related class name of a responsive type number.
   * @param {string} type - The responsive type.
   * @returns {string} The related class name.
   */
  function getResponsiveClass(type) {
    switch (type) {
      case 2:
        return CLASS_HIDE_XS_DOWN;
      case 3:
        return CLASS_HIDE_SM_DOWN;
      case 4:
        return CLASS_HIDE_MD_DOWN;
      default:
        return '';
    }
  }

  /**
   * Get the max ratio of a group of pointers.
   * @param {string} pointers - The target pointers.
   * @returns {number} The result ratio.
   */
  function getMaxZoomRatio(pointers) {
    var pointers2 = _objectSpread2({}, pointers);
    var ratios = [];
    forEach(pointers, function (pointer, pointerId) {
      delete pointers2[pointerId];
      forEach(pointers2, function (pointer2) {
        var x1 = Math.abs(pointer.startX - pointer2.startX);
        var y1 = Math.abs(pointer.startY - pointer2.startY);
        var x2 = Math.abs(pointer.endX - pointer2.endX);
        var y2 = Math.abs(pointer.endY - pointer2.endY);
        var z1 = Math.sqrt(x1 * x1 + y1 * y1);
        var z2 = Math.sqrt(x2 * x2 + y2 * y2);
        var ratio = (z2 - z1) / z1;
        ratios.push(ratio);
      });
    });
    ratios.sort(function (a, b) {
      return Math.abs(a) < Math.abs(b);
    });
    return ratios[0];
  }

  /**
   * Get a pointer from an event object.
   * @param {Object} event - The target event object.
   * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
   * @returns {Object} The result pointer contains start and/or end point coordinates.
   */
  function getPointer(_ref2, endOnly) {
    var pageX = _ref2.pageX,
      pageY = _ref2.pageY;
    var end = {
      endX: pageX,
      endY: pageY
    };
    return endOnly ? end : _objectSpread2({
      timeStamp: Date.now(),
      startX: pageX,
      startY: pageY
    }, end);
  }

  /**
   * Get the center point coordinate of a group of pointers.
   * @param {Object} pointers - The target pointers.
   * @returns {Object} The center point coordinate.
   */
  function getPointersCenter(pointers) {
    var pageX = 0;
    var pageY = 0;
    var count = 0;
    forEach(pointers, function (_ref3) {
      var startX = _ref3.startX,
        startY = _ref3.startY;
      pageX += startX;
      pageY += startY;
      count += 1;
    });
    pageX /= count;
    pageY /= count;
    return {
      pageX: pageX,
      pageY: pageY
    };
  }

  var render = {
    render: function render() {
      this.initContainer();
      this.initViewer();
      this.initList();
      this.renderViewer();
    },
    initBody: function initBody() {
      var ownerDocument = this.element.ownerDocument;
      var body = ownerDocument.body || ownerDocument.documentElement;
      this.body = body;
      this.scrollbarWidth = window.innerWidth - ownerDocument.documentElement.clientWidth;
      this.initialBodyPaddingRight = body.style.paddingRight;
      this.initialBodyComputedPaddingRight = window.getComputedStyle(body).paddingRight;
    },
    initContainer: function initContainer() {
      this.containerData = {
        width: window.innerWidth,
        height: window.innerHeight
      };
    },
    initViewer: function initViewer() {
      var options = this.options,
        parent = this.parent;
      var viewerData;
      if (options.inline) {
        viewerData = {
          width: Math.max(parent.offsetWidth, options.minWidth),
          height: Math.max(parent.offsetHeight, options.minHeight)
        };
        this.parentData = viewerData;
      }
      if (this.fulled || !viewerData) {
        viewerData = this.containerData;
      }
      this.viewerData = assign({}, viewerData);
    },
    renderViewer: function renderViewer() {
      if (this.options.inline && !this.fulled) {
        setStyle(this.viewer, this.viewerData);
      }
    },
    initList: function initList() {
      var _this = this;
      var element = this.element,
        options = this.options,
        list = this.list;
      var items = [];

      // initList may be called in this.update, so should keep idempotent
      list.innerHTML = '';
      forEach(this.images, function (image, index) {
        var src = image.src;
        var alt = image.alt || getImageNameFromURL(src);
        var url = _this.getImageURL(image);
        if (src || url) {
          var item = document.createElement('li');
          var img = document.createElement('img');
          forEach(options.inheritedAttributes, function (name) {
            var value = image.getAttribute(name);
            if (value !== null) {
              img.setAttribute(name, value);
            }
          });
          if (options.navbar) {
            img.src = src || url;
          }
          img.alt = alt;
          img.setAttribute('data-original-url', url || src);
          item.setAttribute('data-index', index);
          item.setAttribute('data-viewer-action', 'view');
          item.setAttribute('role', 'button');
          if (options.keyboard) {
            item.setAttribute('tabindex', 0);
          }
          item.appendChild(img);
          list.appendChild(item);
          items.push(item);
        }
      });
      this.items = items;
      forEach(items, function (item) {
        var image = item.firstElementChild;
        var onLoad;
        var onError;
        setData(image, 'filled', true);
        if (options.loading) {
          addClass(item, CLASS_LOADING);
        }
        addListener(image, EVENT_LOAD, onLoad = function onLoad(event) {
          removeListener(image, EVENT_ERROR, onError);
          if (options.loading) {
            removeClass(item, CLASS_LOADING);
          }
          _this.loadImage(event);
        }, {
          once: true
        });
        addListener(image, EVENT_ERROR, onError = function onError() {
          removeListener(image, EVENT_LOAD, onLoad);
          if (options.loading) {
            removeClass(item, CLASS_LOADING);
          }
        }, {
          once: true
        });
      });
      if (options.transition) {
        addListener(element, EVENT_VIEWED, function () {
          addClass(list, CLASS_TRANSITION);
        }, {
          once: true
        });
      }
    },
    renderList: function renderList() {
      var index = this.index;
      var item = this.items[index];
      if (!item) {
        return;
      }
      var next = item.nextElementSibling;
      var gutter = parseInt(window.getComputedStyle(next || item).marginLeft, 10);
      var offsetWidth = item.offsetWidth;
      var outerWidth = offsetWidth + gutter;

      // Place the active item in the center of the screen
      setStyle(this.list, assign({
        width: outerWidth * this.length - gutter
      }, getTransforms({
        translateX: (this.viewerData.width - offsetWidth) / 2 - outerWidth * index
      })));
    },
    resetList: function resetList() {
      var list = this.list;
      list.innerHTML = '';
      removeClass(list, CLASS_TRANSITION);
      setStyle(list, getTransforms({
        translateX: 0
      }));
    },
    initImage: function initImage(done) {
      var _this2 = this;
      var options = this.options,
        image = this.image,
        viewerData = this.viewerData;
      var footerHeight = this.footer.offsetHeight;
      var viewerWidth = viewerData.width;
      var viewerHeight = Math.max(viewerData.height - footerHeight, footerHeight);
      var oldImageData = this.imageData || {};
      var sizingImage;
      this.imageInitializing = {
        abort: function abort() {
          sizingImage.onload = null;
        }
      };
      sizingImage = getImageNaturalSizes(image, options, function (naturalWidth, naturalHeight) {
        var aspectRatio = naturalWidth / naturalHeight;
        var initialCoverage = Math.max(0, Math.min(1, options.initialCoverage));
        var width = viewerWidth;
        var height = viewerHeight;
        _this2.imageInitializing = false;
        if (viewerHeight * aspectRatio > viewerWidth) {
          height = viewerWidth / aspectRatio;
        } else {
          width = viewerHeight * aspectRatio;
        }
        initialCoverage = isNumber(initialCoverage) ? initialCoverage : 0.9;
        width = Math.min(width * initialCoverage, naturalWidth);
        height = Math.min(height * initialCoverage, naturalHeight);
        var left = (viewerWidth - width) / 2;
        var top = (viewerHeight - height) / 2;
        var imageData = {
          left: left,
          top: top,
          x: left,
          y: top,
          width: width,
          height: height,
          oldRatio: 1,
          ratio: width / naturalWidth,
          aspectRatio: aspectRatio,
          naturalWidth: naturalWidth,
          naturalHeight: naturalHeight
        };
        var initialImageData = assign({}, imageData);
        if (options.rotatable) {
          imageData.rotate = oldImageData.rotate || 0;
          initialImageData.rotate = 0;
        }
        if (options.scalable) {
          imageData.scaleX = oldImageData.scaleX || 1;
          imageData.scaleY = oldImageData.scaleY || 1;
          initialImageData.scaleX = 1;
          initialImageData.scaleY = 1;
        }
        _this2.imageData = imageData;
        _this2.initialImageData = initialImageData;
        if (done) {
          done();
        }
      });
    },
    renderImage: function renderImage(done) {
      var _this3 = this;
      var image = this.image,
        imageData = this.imageData;
      setStyle(image, assign({
        width: imageData.width,
        height: imageData.height,
        // XXX: Not to use translateX/Y to avoid image shaking when zooming
        marginLeft: imageData.x,
        marginTop: imageData.y
      }, getTransforms(imageData)));
      if (done) {
        if ((this.viewing || this.moving || this.rotating || this.scaling || this.zooming) && this.options.transition && hasClass(image, CLASS_TRANSITION)) {
          var onTransitionEnd = function onTransitionEnd() {
            _this3.imageRendering = false;
            done();
          };
          this.imageRendering = {
            abort: function abort() {
              removeListener(image, EVENT_TRANSITION_END, onTransitionEnd);
            }
          };
          addListener(image, EVENT_TRANSITION_END, onTransitionEnd, {
            once: true
          });
        } else {
          done();
        }
      }
    },
    resetImage: function resetImage() {
      // this.image only defined after viewed
      if (this.viewing || this.viewed) {
        var image = this.image;
        if (this.viewing) {
          this.viewing.abort();
        }
        image.parentNode.removeChild(image);
        this.image = null;
      }
    }
  };

  var events = {
    bind: function bind() {
      var options = this.options,
        viewer = this.viewer,
        canvas = this.canvas;
      var document = this.element.ownerDocument;
      addListener(viewer, EVENT_CLICK, this.onClick = this.click.bind(this));
      addListener(viewer, EVENT_DRAG_START, this.onDragStart = this.dragstart.bind(this));
      addListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown = this.pointerdown.bind(this));
      addListener(document, EVENT_POINTER_MOVE, this.onPointerMove = this.pointermove.bind(this));
      addListener(document, EVENT_POINTER_UP, this.onPointerUp = this.pointerup.bind(this));
      addListener(document, EVENT_KEY_DOWN, this.onKeyDown = this.keydown.bind(this));
      addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
      if (options.zoomable && options.zoomOnWheel) {
        addListener(viewer, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
          passive: false,
          capture: true
        });
      }
      if (options.toggleOnDblclick) {
        addListener(canvas, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
      }
    },
    unbind: function unbind() {
      var options = this.options,
        viewer = this.viewer,
        canvas = this.canvas;
      var document = this.element.ownerDocument;
      removeListener(viewer, EVENT_CLICK, this.onClick);
      removeListener(viewer, EVENT_DRAG_START, this.onDragStart);
      removeListener(canvas, EVENT_POINTER_DOWN, this.onPointerDown);
      removeListener(document, EVENT_POINTER_MOVE, this.onPointerMove);
      removeListener(document, EVENT_POINTER_UP, this.onPointerUp);
      removeListener(document, EVENT_KEY_DOWN, this.onKeyDown);
      removeListener(window, EVENT_RESIZE, this.onResize);
      if (options.zoomable && options.zoomOnWheel) {
        removeListener(viewer, EVENT_WHEEL, this.onWheel, {
          passive: false,
          capture: true
        });
      }
      if (options.toggleOnDblclick) {
        removeListener(canvas, EVENT_DBLCLICK, this.onDblclick);
      }
    }
  };

  var handlers = {
    click: function click(event) {
      var options = this.options,
        imageData = this.imageData;
      var target = event.target;
      var action = getData(target, DATA_ACTION);
      if (!action && target.localName === 'img' && target.parentElement.localName === 'li') {
        target = target.parentElement;
        action = getData(target, DATA_ACTION);
      }

      // Cancel the emulated click when the native click event was triggered.
      if (IS_TOUCH_DEVICE && event.isTrusted && target === this.canvas) {
        clearTimeout(this.clickCanvasTimeout);
      }
      switch (action) {
        case 'mix':
          if (this.played) {
            this.stop();
          } else if (options.inline) {
            if (this.fulled) {
              this.exit();
            } else {
              this.full();
            }
          } else {
            this.hide();
          }
          break;
        case 'hide':
          this.hide();
          break;
        case 'view':
          this.view(getData(target, 'index'));
          break;
        case 'zoom-in':
          this.zoom(0.1, true);
          break;
        case 'zoom-out':
          this.zoom(-0.1, true);
          break;
        case 'one-to-one':
          this.toggle();
          break;
        case 'reset':
          this.reset();
          break;
        case 'prev':
          this.prev(options.loop);
          break;
        case 'play':
          this.play(options.fullscreen);
          break;
        case 'next':
          this.next(options.loop);
          break;
        case 'rotate-left':
          this.rotate(-90);
          break;
        case 'rotate-right':
          this.rotate(90);
          break;
        case 'flip-horizontal':
          this.scaleX(-imageData.scaleX || -1);
          break;
        case 'flip-vertical':
          this.scaleY(-imageData.scaleY || -1);
          break;
        default:
          if (this.played) {
            this.stop();
          }
      }
    },
    dblclick: function dblclick(event) {
      event.preventDefault();
      if (this.viewed && event.target === this.image) {
        // Cancel the emulated double click when the native dblclick event was triggered.
        if (IS_TOUCH_DEVICE && event.isTrusted) {
          clearTimeout(this.doubleClickImageTimeout);
        }

        // XXX: No pageX/Y properties in custom event, fallback to the original event.
        this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent);
      }
    },
    load: function load() {
      var _this = this;
      if (this.timeout) {
        clearTimeout(this.timeout);
        this.timeout = false;
      }
      var element = this.element,
        options = this.options,
        image = this.image,
        index = this.index,
        viewerData = this.viewerData;
      removeClass(image, CLASS_INVISIBLE);
      if (options.loading) {
        removeClass(this.canvas, CLASS_LOADING);
      }
      image.style.cssText = 'height:0;' + "margin-left:".concat(viewerData.width / 2, "px;") + "margin-top:".concat(viewerData.height / 2, "px;") + 'max-width:none!important;' + 'position:relative;' + 'width:0;';
      this.initImage(function () {
        toggleClass(image, CLASS_MOVE, options.movable);
        toggleClass(image, CLASS_TRANSITION, options.transition);
        _this.renderImage(function () {
          _this.viewed = true;
          _this.viewing = false;
          if (isFunction(options.viewed)) {
            addListener(element, EVENT_VIEWED, options.viewed, {
              once: true
            });
          }
          dispatchEvent(element, EVENT_VIEWED, {
            originalImage: _this.images[index],
            index: index,
            image: image
          }, {
            cancelable: false
          });
        });
      });
    },
    loadImage: function loadImage(event) {
      var image = event.target;
      var parent = image.parentNode;
      var parentWidth = parent.offsetWidth || 30;
      var parentHeight = parent.offsetHeight || 50;
      var filled = !!getData(image, 'filled');
      getImageNaturalSizes(image, this.options, function (naturalWidth, naturalHeight) {
        var aspectRatio = naturalWidth / naturalHeight;
        var width = parentWidth;
        var height = parentHeight;
        if (parentHeight * aspectRatio > parentWidth) {
          if (filled) {
            width = parentHeight * aspectRatio;
          } else {
            height = parentWidth / aspectRatio;
          }
        } else if (filled) {
          height = parentWidth / aspectRatio;
        } else {
          width = parentHeight * aspectRatio;
        }
        setStyle(image, assign({
          width: width,
          height: height
        }, getTransforms({
          translateX: (parentWidth - width) / 2,
          translateY: (parentHeight - height) / 2
        })));
      });
    },
    keydown: function keydown(event) {
      var options = this.options;
      if (!options.keyboard) {
        return;
      }
      var keyCode = event.keyCode || event.which || event.charCode;
      switch (keyCode) {
        // Enter
        case 13:
          if (this.viewer.contains(event.target)) {
            this.click(event);
          }
          break;
      }
      if (!this.fulled) {
        return;
      }
      switch (keyCode) {
        // Escape
        case 27:
          if (this.played) {
            this.stop();
          } else if (options.inline) {
            if (this.fulled) {
              this.exit();
            }
          } else {
            this.hide();
          }
          break;

        // Space
        case 32:
          if (this.played) {
            this.stop();
          }
          break;

        // ArrowLeft
        case 37:
          if (this.played && this.playing) {
            this.playing.prev();
          } else {
            this.prev(options.loop);
          }
          break;

        // ArrowUp
        case 38:
          // Prevent scroll on Firefox
          event.preventDefault();

          // Zoom in
          this.zoom(options.zoomRatio, true);
          break;

        // ArrowRight
        case 39:
          if (this.played && this.playing) {
            this.playing.next();
          } else {
            this.next(options.loop);
          }
          break;

        // ArrowDown
        case 40:
          // Prevent scroll on Firefox
          event.preventDefault();

          // Zoom out
          this.zoom(-options.zoomRatio, true);
          break;

        // Ctrl + 0
        case 48:
        // Fall through

        // Ctrl + 1
        // eslint-disable-next-line no-fallthrough
        case 49:
          if (event.ctrlKey) {
            event.preventDefault();
            this.toggle();
          }
          break;
      }
    },
    dragstart: function dragstart(event) {
      if (event.target.localName === 'img') {
        event.preventDefault();
      }
    },
    pointerdown: function pointerdown(event) {
      var options = this.options,
        pointers = this.pointers;
      var buttons = event.buttons,
        button = event.button;
      if (!this.viewed || this.showing || this.viewing || this.hiding

      // Handle mouse event and pointer event and ignore touch event
      || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && (
      // No primary button (Usually the left button)
      isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0

      // Open context menu
      || event.ctrlKey)) {
        return;
      }

      // Prevent default behaviours as page zooming in touch devices.
      event.preventDefault();
      if (event.changedTouches) {
        forEach(event.changedTouches, function (touch) {
          pointers[touch.identifier] = getPointer(touch);
        });
      } else {
        pointers[event.pointerId || 0] = getPointer(event);
      }
      var action = options.movable ? ACTION_MOVE : false;
      if (options.zoomOnTouch && options.zoomable && Object.keys(pointers).length > 1) {
        action = ACTION_ZOOM;
      } else if (options.slideOnTouch && (event.pointerType === 'touch' || event.type === 'touchstart') && this.isSwitchable()) {
        action = ACTION_SWITCH;
      }
      if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {
        removeClass(this.image, CLASS_TRANSITION);
      }
      this.action = action;
    },
    pointermove: function pointermove(event) {
      var pointers = this.pointers,
        action = this.action;
      if (!this.viewed || !action) {
        return;
      }
      event.preventDefault();
      if (event.changedTouches) {
        forEach(event.changedTouches, function (touch) {
          assign(pointers[touch.identifier] || {}, getPointer(touch, true));
        });
      } else {
        assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
      }
      this.change(event);
    },
    pointerup: function pointerup(event) {
      var _this2 = this;
      var options = this.options,
        action = this.action,
        pointers = this.pointers;
      var pointer;
      if (event.changedTouches) {
        forEach(event.changedTouches, function (touch) {
          pointer = pointers[touch.identifier];
          delete pointers[touch.identifier];
        });
      } else {
        pointer = pointers[event.pointerId || 0];
        delete pointers[event.pointerId || 0];
      }
      if (!action) {
        return;
      }
      event.preventDefault();
      if (options.transition && (action === ACTION_MOVE || action === ACTION_ZOOM)) {
        addClass(this.image, CLASS_TRANSITION);
      }
      this.action = false;

      // Emulate click and double click in touch devices to support backdrop and image zooming (#210).
      if (IS_TOUCH_DEVICE && action !== ACTION_ZOOM && pointer && Date.now() - pointer.timeStamp < 500) {
        clearTimeout(this.clickCanvasTimeout);
        clearTimeout(this.doubleClickImageTimeout);
        if (options.toggleOnDblclick && this.viewed && event.target === this.image) {
          if (this.imageClicked) {
            this.imageClicked = false;

            // This timeout will be cleared later when a native dblclick event is triggering
            this.doubleClickImageTimeout = setTimeout(function () {
              dispatchEvent(_this2.image, EVENT_DBLCLICK, {
                originalEvent: event
              });
            }, 50);
          } else {
            this.imageClicked = true;

            // The default timing of a double click in Windows is 500 ms
            this.doubleClickImageTimeout = setTimeout(function () {
              _this2.imageClicked = false;
            }, 500);
          }
        } else {
          this.imageClicked = false;
          if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {
            // This timeout will be cleared later when a native click event is triggering
            this.clickCanvasTimeout = setTimeout(function () {
              dispatchEvent(_this2.canvas, EVENT_CLICK, {
                originalEvent: event
              });
            }, 50);
          }
        }
      }
    },
    resize: function resize() {
      var _this3 = this;
      if (!this.isShown || this.hiding) {
        return;
      }
      if (this.fulled) {
        this.close();
        this.initBody();
        this.open();
      }
      this.initContainer();
      this.initViewer();
      this.renderViewer();
      this.renderList();
      if (this.viewed) {
        this.initImage(function () {
          _this3.renderImage();
        });
      }
      if (this.played) {
        if (this.options.fullscreen && this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
          this.stop();
          return;
        }
        forEach(this.player.getElementsByTagName('img'), function (image) {
          addListener(image, EVENT_LOAD, _this3.loadImage.bind(_this3), {
            once: true
          });
          dispatchEvent(image, EVENT_LOAD);
        });
      }
    },
    wheel: function wheel(event) {
      var _this4 = this;
      if (!this.viewed) {
        return;
      }
      event.preventDefault();

      // Limit wheel speed to prevent zoom too fast
      if (this.wheeling) {
        return;
      }
      this.wheeling = true;
      setTimeout(function () {
        _this4.wheeling = false;
      }, 50);
      var ratio = Number(this.options.zoomRatio) || 0.1;
      var delta = 1;
      if (event.deltaY) {
        delta = event.deltaY > 0 ? 1 : -1;
      } else if (event.wheelDelta) {
        delta = -event.wheelDelta / 120;
      } else if (event.detail) {
        delta = event.detail > 0 ? 1 : -1;
      }
      this.zoom(-delta * ratio, true, null, event);
    }
  };

  var methods = {
    /** Show the viewer (only available in modal mode)
     * @param {boolean} [immediate=false] - Indicates if show the viewer immediately or not.
     * @returns {Viewer} this
     */show: function show() {
      var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var element = this.element,
        options = this.options;
      if (options.inline || this.showing || this.isShown || this.showing) {
        return this;
      }
      if (!this.ready) {
        this.build();
        if (this.ready) {
          this.show(immediate);
        }
        return this;
      }
      if (isFunction(options.show)) {
        addListener(element, EVENT_SHOW, options.show, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_SHOW) === false || !this.ready) {
        return this;
      }
      if (this.hiding) {
        this.transitioning.abort();
      }
      this.showing = true;
      this.open();
      var viewer = this.viewer;
      removeClass(viewer, CLASS_HIDE);
      viewer.setAttribute('role', 'dialog');
      viewer.setAttribute('aria-labelledby', this.title.id);
      viewer.setAttribute('aria-modal', true);
      viewer.removeAttribute('aria-hidden');
      if (options.transition && !immediate) {
        var shown = this.shown.bind(this);
        this.transitioning = {
          abort: function abort() {
            removeListener(viewer, EVENT_TRANSITION_END, shown);
            removeClass(viewer, CLASS_IN);
          }
        };
        addClass(viewer, CLASS_TRANSITION);

        // Force reflow to enable CSS3 transition
        viewer.initialOffsetWidth = viewer.offsetWidth;
        addListener(viewer, EVENT_TRANSITION_END, shown, {
          once: true
        });
        addClass(viewer, CLASS_IN);
      } else {
        addClass(viewer, CLASS_IN);
        this.shown();
      }
      return this;
    },
    /**
     * Hide the viewer (only available in modal mode)
     * @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
     * @returns {Viewer} this
     */hide: function hide() {
      var _this = this;
      var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var element = this.element,
        options = this.options;
      if (options.inline || this.hiding || !(this.isShown || this.showing)) {
        return this;
      }
      if (isFunction(options.hide)) {
        addListener(element, EVENT_HIDE, options.hide, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_HIDE) === false) {
        return this;
      }
      if (this.showing) {
        this.transitioning.abort();
      }
      this.hiding = true;
      if (this.played) {
        this.stop();
      } else if (this.viewing) {
        this.viewing.abort();
      }
      var viewer = this.viewer,
        image = this.image;
      var hideImmediately = function hideImmediately() {
        removeClass(viewer, CLASS_IN);
        _this.hidden();
      };
      if (options.transition && !immediate) {
        var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
          // Ignore all propagating `transitionend` events (#275).
          if (event && event.target === viewer) {
            removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
            _this.hidden();
          }
        };
        var onImageTransitionEnd = function onImageTransitionEnd() {
          // In case of show the viewer by `viewer.show(true)` previously (#407).
          if (hasClass(viewer, CLASS_TRANSITION)) {
            addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
            removeClass(viewer, CLASS_IN);
          } else {
            hideImmediately();
          }
        };
        this.transitioning = {
          abort: function abort() {
            if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
              removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
            } else if (hasClass(viewer, CLASS_TRANSITION)) {
              removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
            }
          }
        };

        // In case of hiding the viewer when holding on the image (#255),
        // note that the `CLASS_TRANSITION` class will be removed on pointer down.
        if (this.viewed && hasClass(image, CLASS_TRANSITION)) {
          addListener(image, EVENT_TRANSITION_END, onImageTransitionEnd, {
            once: true
          });
          this.zoomTo(0, false, null, null, true);
        } else {
          onImageTransitionEnd();
        }
      } else {
        hideImmediately();
      }
      return this;
    },
    /**
     * View one of the images with image's index
     * @param {number} index - The index of the image to view.
     * @returns {Viewer} this
     */view: function view() {
      var _this2 = this;
      var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.initialViewIndex;
      index = Number(index) || 0;
      if (this.hiding || this.played || index < 0 || index >= this.length || this.viewed && index === this.index) {
        return this;
      }
      if (!this.isShown) {
        this.index = index;
        return this.show();
      }
      if (this.viewing) {
        this.viewing.abort();
      }
      var element = this.element,
        options = this.options,
        title = this.title,
        canvas = this.canvas;
      var item = this.items[index];
      var img = item.querySelector('img');
      var url = getData(img, 'originalUrl');
      var alt = img.getAttribute('alt');
      var image = document.createElement('img');
      forEach(options.inheritedAttributes, function (name) {
        var value = img.getAttribute(name);
        if (value !== null) {
          image.setAttribute(name, value);
        }
      });
      image.src = url;
      image.alt = alt;
      if (isFunction(options.view)) {
        addListener(element, EVENT_VIEW, options.view, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_VIEW, {
        originalImage: this.images[index],
        index: index,
        image: image
      }) === false || !this.isShown || this.hiding || this.played) {
        return this;
      }
      var activeItem = this.items[this.index];
      if (activeItem) {
        removeClass(activeItem, CLASS_ACTIVE);
        activeItem.removeAttribute('aria-selected');
      }
      addClass(item, CLASS_ACTIVE);
      item.setAttribute('aria-selected', true);
      if (options.focus) {
        item.focus();
      }
      this.image = image;
      this.viewed = false;
      this.index = index;
      this.imageData = {};
      addClass(image, CLASS_INVISIBLE);
      if (options.loading) {
        addClass(canvas, CLASS_LOADING);
      }
      canvas.innerHTML = '';
      canvas.appendChild(image);

      // Center current item
      this.renderList();

      // Clear title
      title.innerHTML = '';

      // Generate title after viewed
      var onViewed = function onViewed() {
        var imageData = _this2.imageData;
        var render = Array.isArray(options.title) ? options.title[1] : options.title;
        title.innerHTML = escapeHTMLEntities(isFunction(render) ? render.call(_this2, image, imageData) : "".concat(alt, " (").concat(imageData.naturalWidth, " \xD7 ").concat(imageData.naturalHeight, ")"));
      };
      var onLoad;
      var onError;
      addListener(element, EVENT_VIEWED, onViewed, {
        once: true
      });
      this.viewing = {
        abort: function abort() {
          removeListener(element, EVENT_VIEWED, onViewed);
          if (image.complete) {
            if (_this2.imageRendering) {
              _this2.imageRendering.abort();
            } else if (_this2.imageInitializing) {
              _this2.imageInitializing.abort();
            }
          } else {
            // Cancel download to save bandwidth.
            image.src = '';
            removeListener(image, EVENT_LOAD, onLoad);
            if (_this2.timeout) {
              clearTimeout(_this2.timeout);
            }
          }
        }
      };
      if (image.complete) {
        this.load();
      } else {
        addListener(image, EVENT_LOAD, onLoad = function onLoad() {
          removeListener(image, EVENT_ERROR, onError);
          _this2.load();
        }, {
          once: true
        });
        addListener(image, EVENT_ERROR, onError = function onError() {
          removeListener(image, EVENT_LOAD, onLoad);
          if (_this2.timeout) {
            clearTimeout(_this2.timeout);
            _this2.timeout = false;
          }
          removeClass(image, CLASS_INVISIBLE);
          if (options.loading) {
            removeClass(_this2.canvas, CLASS_LOADING);
          }
        }, {
          once: true
        });
        if (this.timeout) {
          clearTimeout(this.timeout);
        }

        // Make the image visible if it fails to load within 1s
        this.timeout = setTimeout(function () {
          removeClass(image, CLASS_INVISIBLE);
          _this2.timeout = false;
        }, 1000);
      }
      return this;
    },
    /**
     * View the previous image
     * @param {boolean} [loop=false] - Indicate if view the last one
     * when it is the first one at present.
     * @returns {Viewer} this
     */prev: function prev() {
      var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var index = this.index - 1;
      if (index < 0) {
        index = loop ? this.length - 1 : 0;
      }
      this.view(index);
      return this;
    },
    /**
     * View the next image
     * @param {boolean} [loop=false] - Indicate if view the first one
     * when it is the last one at present.
     * @returns {Viewer} this
     */next: function next() {
      var loop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var maxIndex = this.length - 1;
      var index = this.index + 1;
      if (index > maxIndex) {
        index = loop ? 0 : maxIndex;
      }
      this.view(index);
      return this;
    },
    /**
     * Move the image with relative offsets.
     * @param {number} x - The moving distance in the horizontal direction.
     * @param {number} [y=x] The moving distance in the vertical direction.
     * @returns {Viewer} this
     */move: function move(x) {
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
      var imageData = this.imageData;
      this.moveTo(isUndefined(x) ? x : imageData.x + Number(x), isUndefined(y) ? y : imageData.y + Number(y));
      return this;
    },
    /**
     * Move the image to an absolute point.
     * @param {number} x - The new position in the horizontal direction.
     * @param {number} [y=x] - The new position in the vertical direction.
     * @param {Event} [_originalEvent=null] - The original event if any.
     * @returns {Viewer} this
     */moveTo: function moveTo(x) {
      var _this3 = this;
      var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
      var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
      var element = this.element,
        options = this.options,
        imageData = this.imageData;
      x = Number(x);
      y = Number(y);
      if (this.viewed && !this.played && options.movable) {
        var oldX = imageData.x;
        var oldY = imageData.y;
        var changed = false;
        if (isNumber(x)) {
          changed = true;
        } else {
          x = oldX;
        }
        if (isNumber(y)) {
          changed = true;
        } else {
          y = oldY;
        }
        if (changed) {
          if (isFunction(options.move)) {
            addListener(element, EVENT_MOVE, options.move, {
              once: true
            });
          }
          if (dispatchEvent(element, EVENT_MOVE, {
            x: x,
            y: y,
            oldX: oldX,
            oldY: oldY,
            originalEvent: _originalEvent
          }) === false) {
            return this;
          }
          imageData.x = x;
          imageData.y = y;
          imageData.left = x;
          imageData.top = y;
          this.moving = true;
          this.renderImage(function () {
            _this3.moving = false;
            if (isFunction(options.moved)) {
              addListener(element, EVENT_MOVED, options.moved, {
                once: true
              });
            }
            dispatchEvent(element, EVENT_MOVED, {
              x: x,
              y: y,
              oldX: oldX,
              oldY: oldY,
              originalEvent: _originalEvent
            }, {
              cancelable: false
            });
          });
        }
      }
      return this;
    },
    /**
     * Rotate the image with a relative degree.
     * @param {number} degree - The rotate degree.
     * @returns {Viewer} this
     */rotate: function rotate(degree) {
      this.rotateTo((this.imageData.rotate || 0) + Number(degree));
      return this;
    },
    /**
     * Rotate the image to an absolute degree.
     * @param {number} degree - The rotate degree.
     * @returns {Viewer} this
     */rotateTo: function rotateTo(degree) {
      var _this4 = this;
      var element = this.element,
        options = this.options,
        imageData = this.imageData;
      degree = Number(degree);
      if (isNumber(degree) && this.viewed && !this.played && options.rotatable) {
        var oldDegree = imageData.rotate;
        if (isFunction(options.rotate)) {
          addListener(element, EVENT_ROTATE, options.rotate, {
            once: true
          });
        }
        if (dispatchEvent(element, EVENT_ROTATE, {
          degree: degree,
          oldDegree: oldDegree
        }) === false) {
          return this;
        }
        imageData.rotate = degree;
        this.rotating = true;
        this.renderImage(function () {
          _this4.rotating = false;
          if (isFunction(options.rotated)) {
            addListener(element, EVENT_ROTATED, options.rotated, {
              once: true
            });
          }
          dispatchEvent(element, EVENT_ROTATED, {
            degree: degree,
            oldDegree: oldDegree
          }, {
            cancelable: false
          });
        });
      }
      return this;
    },
    /**
     * Scale the image on the x-axis.
     * @param {number} scaleX - The scale ratio on the x-axis.
     * @returns {Viewer} this
     */scaleX: function scaleX(_scaleX) {
      this.scale(_scaleX, this.imageData.scaleY);
      return this;
    },
    /**
     * Scale the image on the y-axis.
     * @param {number} scaleY - The scale ratio on the y-axis.
     * @returns {Viewer} this
     */scaleY: function scaleY(_scaleY) {
      this.scale(this.imageData.scaleX, _scaleY);
      return this;
    },
    /**
     * Scale the image.
     * @param {number} scaleX - The scale ratio on the x-axis.
     * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
     * @returns {Viewer} this
     */scale: function scale(scaleX) {
      var _this5 = this;
      var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
      var element = this.element,
        options = this.options,
        imageData = this.imageData;
      scaleX = Number(scaleX);
      scaleY = Number(scaleY);
      if (this.viewed && !this.played && options.scalable) {
        var oldScaleX = imageData.scaleX;
        var oldScaleY = imageData.scaleY;
        var changed = false;
        if (isNumber(scaleX)) {
          changed = true;
        } else {
          scaleX = oldScaleX;
        }
        if (isNumber(scaleY)) {
          changed = true;
        } else {
          scaleY = oldScaleY;
        }
        if (changed) {
          if (isFunction(options.scale)) {
            addListener(element, EVENT_SCALE, options.scale, {
              once: true
            });
          }
          if (dispatchEvent(element, EVENT_SCALE, {
            scaleX: scaleX,
            scaleY: scaleY,
            oldScaleX: oldScaleX,
            oldScaleY: oldScaleY
          }) === false) {
            return this;
          }
          imageData.scaleX = scaleX;
          imageData.scaleY = scaleY;
          this.scaling = true;
          this.renderImage(function () {
            _this5.scaling = false;
            if (isFunction(options.scaled)) {
              addListener(element, EVENT_SCALED, options.scaled, {
                once: true
              });
            }
            dispatchEvent(element, EVENT_SCALED, {
              scaleX: scaleX,
              scaleY: scaleY,
              oldScaleX: oldScaleX,
              oldScaleY: oldScaleY
            }, {
              cancelable: false
            });
          });
        }
      }
      return this;
    },
    /**
     * Zoom the image with a relative ratio.
     * @param {number} ratio - The target ratio.
     * @param {boolean} [showTooltip=false] - Indicates whether to show the tooltip.
     * @param {Object} [pivot] - The pivot point coordinate for zooming.
     * @param {Event} [_originalEvent=null] - The original event if any.
     * @returns {Viewer} this
     */zoom: function zoom(ratio) {
      var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
      var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
      var imageData = this.imageData;
      ratio = Number(ratio);
      if (ratio < 0) {
        ratio = 1 / (1 - ratio);
      } else {
        ratio = 1 + ratio;
      }
      this.zoomTo(imageData.width * ratio / imageData.naturalWidth, showTooltip, pivot, _originalEvent);
      return this;
    },
    /**
     * Zoom the image to an absolute ratio.
     * @param {number} ratio - The target ratio.
     * @param {boolean} [showTooltip] - Indicates whether to show the tooltip.
     * @param {Object} [pivot] - The pivot point coordinate for zooming.
     * @param {Event} [_originalEvent=null] - The original event if any.
     * @param {Event} [_zoomable=false] - Indicates if the current zoom is available or not.
     * @returns {Viewer} this
     */zoomTo: function zoomTo(ratio) {
      var _this6 = this;
      var showTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      var pivot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
      var _originalEvent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
      var _zoomable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
      var element = this.element,
        options = this.options,
        pointers = this.pointers,
        imageData = this.imageData;
      var x = imageData.x,
        y = imageData.y,
        width = imageData.width,
        height = imageData.height,
        naturalWidth = imageData.naturalWidth,
        naturalHeight = imageData.naturalHeight;
      ratio = Math.max(0, ratio);
      if (isNumber(ratio) && this.viewed && !this.played && (_zoomable || options.zoomable)) {
        if (!_zoomable) {
          var minZoomRatio = Math.max(0.01, options.minZoomRatio);
          var maxZoomRatio = Math.min(100, options.maxZoomRatio);
          ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);
        }
        if (_originalEvent) {
          switch (_originalEvent.type) {
            case 'wheel':
              if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
                ratio = 1;
              }
              break;
            case 'pointermove':
            case 'touchmove':
            case 'mousemove':
              if (ratio > 0.99 && ratio < 1.01) {
                ratio = 1;
              }
              break;
          }
        }
        var newWidth = naturalWidth * ratio;
        var newHeight = naturalHeight * ratio;
        var offsetWidth = newWidth - width;
        var offsetHeight = newHeight - height;
        var oldRatio = imageData.ratio;
        if (isFunction(options.zoom)) {
          addListener(element, EVENT_ZOOM, options.zoom, {
            once: true
          });
        }
        if (dispatchEvent(element, EVENT_ZOOM, {
          ratio: ratio,
          oldRatio: oldRatio,
          originalEvent: _originalEvent
        }) === false) {
          return this;
        }
        this.zooming = true;
        if (_originalEvent) {
          var offset = getOffset(this.viewer);
          var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : {
            pageX: _originalEvent.pageX,
            pageY: _originalEvent.pageY
          };

          // Zoom from the triggering point of the event
          imageData.x -= offsetWidth * ((center.pageX - offset.left - x) / width);
          imageData.y -= offsetHeight * ((center.pageY - offset.top - y) / height);
        } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
          imageData.x -= offsetWidth * ((pivot.x - x) / width);
          imageData.y -= offsetHeight * ((pivot.y - y) / height);
        } else {
          // Zoom from the center of the image
          imageData.x -= offsetWidth / 2;
          imageData.y -= offsetHeight / 2;
        }
        imageData.left = imageData.x;
        imageData.top = imageData.y;
        imageData.width = newWidth;
        imageData.height = newHeight;
        imageData.oldRatio = oldRatio;
        imageData.ratio = ratio;
        this.renderImage(function () {
          _this6.zooming = false;
          if (isFunction(options.zoomed)) {
            addListener(element, EVENT_ZOOMED, options.zoomed, {
              once: true
            });
          }
          dispatchEvent(element, EVENT_ZOOMED, {
            ratio: ratio,
            oldRatio: oldRatio,
            originalEvent: _originalEvent
          }, {
            cancelable: false
          });
        });
        if (showTooltip) {
          this.tooltip();
        }
      }
      return this;
    },
    /**
     * Play the images
     * @param {boolean|FullscreenOptions} [fullscreen=false] - Indicate if request fullscreen or not.
     * @returns {Viewer} this
     */play: function play() {
      var _this7 = this;
      var fullscreen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      if (!this.isShown || this.played) {
        return this;
      }
      var element = this.element,
        options = this.options;
      if (isFunction(options.play)) {
        addListener(element, EVENT_PLAY, options.play, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_PLAY) === false) {
        return this;
      }
      var player = this.player;
      var onLoad = this.loadImage.bind(this);
      var list = [];
      var total = 0;
      var index = 0;
      this.played = true;
      this.onLoadWhenPlay = onLoad;
      if (fullscreen) {
        this.requestFullscreen(fullscreen);
      }
      addClass(player, CLASS_SHOW);
      forEach(this.items, function (item, i) {
        var img = item.querySelector('img');
        var image = document.createElement('img');
        image.src = getData(img, 'originalUrl');
        image.alt = img.getAttribute('alt');
        image.referrerPolicy = img.referrerPolicy;
        total += 1;
        addClass(image, CLASS_FADE);
        toggleClass(image, CLASS_TRANSITION, options.transition);
        if (hasClass(item, CLASS_ACTIVE)) {
          addClass(image, CLASS_IN);
          index = i;
        }
        list.push(image);
        addListener(image, EVENT_LOAD, onLoad, {
          once: true
        });
        player.appendChild(image);
      });
      if (isNumber(options.interval) && options.interval > 0) {
        var prev = function prev() {
          clearTimeout(_this7.playing.timeout);
          removeClass(list[index], CLASS_IN);
          index -= 1;
          index = index >= 0 ? index : total - 1;
          addClass(list[index], CLASS_IN);
          _this7.playing.timeout = setTimeout(prev, options.interval);
        };
        var next = function next() {
          clearTimeout(_this7.playing.timeout);
          removeClass(list[index], CLASS_IN);
          index += 1;
          index = index < total ? index : 0;
          addClass(list[index], CLASS_IN);
          _this7.playing.timeout = setTimeout(next, options.interval);
        };
        if (total > 1) {
          this.playing = {
            prev: prev,
            next: next,
            timeout: setTimeout(next, options.interval)
          };
        }
      }
      return this;
    },
    // Stop play
    stop: function stop() {
      var _this8 = this;
      if (!this.played) {
        return this;
      }
      var element = this.element,
        options = this.options;
      if (isFunction(options.stop)) {
        addListener(element, EVENT_STOP, options.stop, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_STOP) === false) {
        return this;
      }
      var player = this.player;
      clearTimeout(this.playing.timeout);
      this.playing = false;
      this.played = false;
      forEach(player.getElementsByTagName('img'), function (image) {
        removeListener(image, EVENT_LOAD, _this8.onLoadWhenPlay);
      });
      removeClass(player, CLASS_SHOW);
      player.innerHTML = '';
      this.exitFullscreen();
      return this;
    },
    // Enter modal mode (only available in inline mode)
    full: function full() {
      var _this9 = this;
      var options = this.options,
        viewer = this.viewer,
        image = this.image,
        list = this.list;
      if (!this.isShown || this.played || this.fulled || !options.inline) {
        return this;
      }
      this.fulled = true;
      this.open();
      addClass(this.button, CLASS_FULLSCREEN_EXIT);
      if (options.transition) {
        removeClass(list, CLASS_TRANSITION);
        if (this.viewed) {
          removeClass(image, CLASS_TRANSITION);
        }
      }
      addClass(viewer, CLASS_FIXED);
      viewer.setAttribute('role', 'dialog');
      viewer.setAttribute('aria-labelledby', this.title.id);
      viewer.setAttribute('aria-modal', true);
      viewer.removeAttribute('style');
      setStyle(viewer, {
        zIndex: options.zIndex
      });
      if (options.focus) {
        this.enforceFocus();
      }
      this.initContainer();
      this.viewerData = assign({}, this.containerData);
      this.renderList();
      if (this.viewed) {
        this.initImage(function () {
          _this9.renderImage(function () {
            if (options.transition) {
              setTimeout(function () {
                addClass(image, CLASS_TRANSITION);
                addClass(list, CLASS_TRANSITION);
              }, 0);
            }
          });
        });
      }
      return this;
    },
    // Exit modal mode (only available in inline mode)
    exit: function exit() {
      var _this10 = this;
      var options = this.options,
        viewer = this.viewer,
        image = this.image,
        list = this.list;
      if (!this.isShown || this.played || !this.fulled || !options.inline) {
        return this;
      }
      this.fulled = false;
      this.close();
      removeClass(this.button, CLASS_FULLSCREEN_EXIT);
      if (options.transition) {
        removeClass(list, CLASS_TRANSITION);
        if (this.viewed) {
          removeClass(image, CLASS_TRANSITION);
        }
      }
      if (options.focus) {
        this.clearEnforceFocus();
      }
      viewer.removeAttribute('role');
      viewer.removeAttribute('aria-labelledby');
      viewer.removeAttribute('aria-modal');
      removeClass(viewer, CLASS_FIXED);
      setStyle(viewer, {
        zIndex: options.zIndexInline
      });
      this.viewerData = assign({}, this.parentData);
      this.renderViewer();
      this.renderList();
      if (this.viewed) {
        this.initImage(function () {
          _this10.renderImage(function () {
            if (options.transition) {
              setTimeout(function () {
                addClass(image, CLASS_TRANSITION);
                addClass(list, CLASS_TRANSITION);
              }, 0);
            }
          });
        });
      }
      return this;
    },
    // Show the current ratio of the image with percentage
    tooltip: function tooltip() {
      var _this11 = this;
      var options = this.options,
        tooltipBox = this.tooltipBox,
        imageData = this.imageData;
      if (!this.viewed || this.played || !options.tooltip) {
        return this;
      }
      tooltipBox.textContent = "".concat(Math.round(imageData.ratio * 100), "%");
      if (!this.tooltipping) {
        if (options.transition) {
          if (this.fading) {
            dispatchEvent(tooltipBox, EVENT_TRANSITION_END);
          }
          addClass(tooltipBox, CLASS_SHOW);
          addClass(tooltipBox, CLASS_FADE);
          addClass(tooltipBox, CLASS_TRANSITION);
          tooltipBox.removeAttribute('aria-hidden');

          // Force reflow to enable CSS3 transition
          tooltipBox.initialOffsetWidth = tooltipBox.offsetWidth;
          addClass(tooltipBox, CLASS_IN);
        } else {
          addClass(tooltipBox, CLASS_SHOW);
          tooltipBox.removeAttribute('aria-hidden');
        }
      } else {
        clearTimeout(this.tooltipping);
      }
      this.tooltipping = setTimeout(function () {
        if (options.transition) {
          addListener(tooltipBox, EVENT_TRANSITION_END, function () {
            removeClass(tooltipBox, CLASS_SHOW);
            removeClass(tooltipBox, CLASS_FADE);
            removeClass(tooltipBox, CLASS_TRANSITION);
            tooltipBox.setAttribute('aria-hidden', true);
            _this11.fading = false;
          }, {
            once: true
          });
          removeClass(tooltipBox, CLASS_IN);
          _this11.fading = true;
        } else {
          removeClass(tooltipBox, CLASS_SHOW);
          tooltipBox.setAttribute('aria-hidden', true);
        }
        _this11.tooltipping = false;
      }, 1000);
      return this;
    },
    /**
     * Toggle the image size between its current size and natural size
     * @param {Event} [_originalEvent=null] - The original event if any.
     * @returns {Viewer} this
     */toggle: function toggle() {
      var _originalEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      if (this.imageData.ratio === 1) {
        this.zoomTo(this.imageData.oldRatio, true, null, _originalEvent);
      } else {
        this.zoomTo(1, true, null, _originalEvent);
      }
      return this;
    },
    // Reset the image to its initial state
    reset: function reset() {
      if (this.viewed && !this.played) {
        this.imageData = assign({}, this.initialImageData);
        this.renderImage();
      }
      return this;
    },
    // Update viewer when images changed
    update: function update() {
      var _this12 = this;
      var element = this.element,
        options = this.options,
        isImg = this.isImg;

      // Destroy viewer if the target image was deleted
      if (isImg && !element.parentNode) {
        return this.destroy();
      }
      var images = [];
      forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
        if (isFunction(options.filter)) {
          if (options.filter.call(_this12, image)) {
            images.push(image);
          }
        } else if (_this12.getImageURL(image)) {
          images.push(image);
        }
      });
      if (!images.length) {
        return this;
      }
      this.images = images;
      this.length = images.length;
      if (this.ready) {
        var changedIndexes = [];
        forEach(this.items, function (item, i) {
          var img = item.querySelector('img');
          var image = images[i];
          if (image && img) {
            if (image.src !== img.src

            // Title changed (#408)
            || image.alt !== img.alt) {
              changedIndexes.push(i);
            }
          } else {
            changedIndexes.push(i);
          }
        });
        setStyle(this.list, {
          width: 'auto'
        });
        this.initList();
        if (this.isShown) {
          if (this.length) {
            if (this.viewed) {
              var changedIndex = changedIndexes.indexOf(this.index);
              if (changedIndex >= 0) {
                this.viewed = false;
                this.view(Math.max(Math.min(this.index - changedIndex, this.length - 1), 0));
              } else {
                var activeItem = this.items[this.index];

                // Reactivate the current viewing item after reset the list.
                addClass(activeItem, CLASS_ACTIVE);
                activeItem.setAttribute('aria-selected', true);
              }
            }
          } else {
            this.image = null;
            this.viewed = false;
            this.index = 0;
            this.imageData = {};
            this.canvas.innerHTML = '';
            this.title.innerHTML = '';
          }
        }
      } else {
        this.build();
      }
      return this;
    },
    // Destroy the viewer
    destroy: function destroy() {
      var element = this.element,
        options = this.options;
      if (!element[NAMESPACE]) {
        return this;
      }
      this.destroyed = true;
      if (this.ready) {
        if (this.played) {
          this.stop();
        }
        if (options.inline) {
          if (this.fulled) {
            this.exit();
          }
          this.unbind();
        } else if (this.isShown) {
          if (this.viewing) {
            if (this.imageRendering) {
              this.imageRendering.abort();
            } else if (this.imageInitializing) {
              this.imageInitializing.abort();
            }
          }
          if (this.hiding) {
            this.transitioning.abort();
          }
          this.hidden();
        } else if (this.showing) {
          this.transitioning.abort();
          this.hidden();
        }
        this.ready = false;
        this.viewer.parentNode.removeChild(this.viewer);
      } else if (options.inline) {
        if (this.delaying) {
          this.delaying.abort();
        } else if (this.initializing) {
          this.initializing.abort();
        }
      }
      if (!options.inline) {
        removeListener(element, EVENT_CLICK, this.onStart);
      }
      element[NAMESPACE] = undefined;
      return this;
    }
  };

  var others = {
    getImageURL: function getImageURL(image) {
      var url = this.options.url;
      if (isString(url)) {
        url = image.getAttribute(url);
      } else if (isFunction(url)) {
        url = url.call(this, image);
      } else {
        url = '';
      }
      return url;
    },
    enforceFocus: function enforceFocus() {
      var _this = this;
      this.clearEnforceFocus();
      addListener(document, EVENT_FOCUSIN, this.onFocusin = function (event) {
        var viewer = _this.viewer;
        var target = event.target;
        if (target === document || target === viewer || viewer.contains(target)) {
          return;
        }
        while (target) {
          // Avoid conflicts with other modals (#474, #540)
          if (target.getAttribute('tabindex') !== null || target.getAttribute('aria-modal') === 'true') {
            return;
          }
          target = target.parentElement;
        }
        viewer.focus();
      });
    },
    clearEnforceFocus: function clearEnforceFocus() {
      if (this.onFocusin) {
        removeListener(document, EVENT_FOCUSIN, this.onFocusin);
        this.onFocusin = null;
      }
    },
    open: function open() {
      var body = this.body;
      addClass(body, CLASS_OPEN);
      if (this.scrollbarWidth > 0) {
        body.style.paddingRight = "".concat(this.scrollbarWidth + (parseFloat(this.initialBodyComputedPaddingRight) || 0), "px");
      }
    },
    close: function close() {
      var body = this.body;
      removeClass(body, CLASS_OPEN);
      if (this.scrollbarWidth > 0) {
        body.style.paddingRight = this.initialBodyPaddingRight;
      }
    },
    shown: function shown() {
      var element = this.element,
        options = this.options,
        viewer = this.viewer;
      this.fulled = true;
      this.isShown = true;
      this.render();
      this.bind();
      this.showing = false;
      if (options.focus) {
        viewer.focus();
        this.enforceFocus();
      }
      if (isFunction(options.shown)) {
        addListener(element, EVENT_SHOWN, options.shown, {
          once: true
        });
      }
      if (dispatchEvent(element, EVENT_SHOWN) === false) {
        return;
      }
      if (this.ready && this.isShown && !this.hiding) {
        this.view(this.index);
      }
    },
    hidden: function hidden() {
      var element = this.element,
        options = this.options,
        viewer = this.viewer;
      if (options.fucus) {
        this.clearEnforceFocus();
      }
      this.fulled = false;
      this.viewed = false;
      this.isShown = false;
      this.close();
      this.unbind();
      addClass(viewer, CLASS_HIDE);
      viewer.removeAttribute('role');
      viewer.removeAttribute('aria-labelledby');
      viewer.removeAttribute('aria-modal');
      viewer.setAttribute('aria-hidden', true);
      this.resetList();
      this.resetImage();
      this.hiding = false;
      if (!this.destroyed) {
        if (isFunction(options.hidden)) {
          addListener(element, EVENT_HIDDEN, options.hidden, {
            once: true
          });
        }
        dispatchEvent(element, EVENT_HIDDEN, null, {
          cancelable: false
        });
      }
    },
    requestFullscreen: function requestFullscreen(options) {
      var document = this.element.ownerDocument;
      if (this.fulled && !(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
        var documentElement = document.documentElement;

        // Element.requestFullscreen()
        if (documentElement.requestFullscreen) {
          // Avoid TypeError when convert `options` to dictionary
          if (isPlainObject(options)) {
            documentElement.requestFullscreen(options);
          } else {
            documentElement.requestFullscreen();
          }
        } else if (documentElement.webkitRequestFullscreen) {
          documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
        } else if (documentElement.mozRequestFullScreen) {
          documentElement.mozRequestFullScreen();
        } else if (documentElement.msRequestFullscreen) {
          documentElement.msRequestFullscreen();
        }
      }
    },
    exitFullscreen: function exitFullscreen() {
      var document = this.element.ownerDocument;
      if (this.fulled && (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)) {
        // Document.exitFullscreen()
        if (document.exitFullscreen) {
          document.exitFullscreen();
        } else if (document.webkitExitFullscreen) {
          document.webkitExitFullscreen();
        } else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if (document.msExitFullscreen) {
          document.msExitFullscreen();
        }
      }
    },
    change: function change(event) {
      var options = this.options,
        pointers = this.pointers;
      var pointer = pointers[Object.keys(pointers)[0]];

      // In the case of the `pointers` object is empty (#421)
      if (!pointer) {
        return;
      }
      var offsetX = pointer.endX - pointer.startX;
      var offsetY = pointer.endY - pointer.startY;
      switch (this.action) {
        // Move the current image
        case ACTION_MOVE:
          this.move(offsetX, offsetY, event);
          break;

        // Zoom the current image
        case ACTION_ZOOM:
          this.zoom(getMaxZoomRatio(pointers), false, null, event);
          break;
        case ACTION_SWITCH:
          {
            this.action = 'switched';
            var absoluteOffsetX = Math.abs(offsetX);
            if (absoluteOffsetX > 1 && absoluteOffsetX > Math.abs(offsetY)) {
              // Empty `pointers` as `touchend` event will not be fired after swiped in iOS browsers.
              this.pointers = {};
              if (offsetX > 1) {
                this.prev(options.loop);
              } else if (offsetX < -1) {
                this.next(options.loop);
              }
            }
            break;
          }
      }

      // Override
      forEach(pointers, function (p) {
        p.startX = p.endX;
        p.startY = p.endY;
      });
    },
    isSwitchable: function isSwitchable() {
      var imageData = this.imageData,
        viewerData = this.viewerData;
      return this.length > 1 && imageData.x >= 0 && imageData.y >= 0 && imageData.width <= viewerData.width && imageData.height <= viewerData.height;
    }
  };

  var AnotherViewer = WINDOW.Viewer;
  var getUniqueID = function (id) {
    return function () {
      id += 1;
      return id;
    };
  }(-1);
  var Viewer = /*#__PURE__*/function () {
    /**
     * Create a new Viewer.
     * @param {Element} element - The target element for viewing.
     * @param {Object} [options={}] - The configuration options.
     */
    function Viewer(element) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      _classCallCheck(this, Viewer);
      if (!element || element.nodeType !== 1) {
        throw new Error('The first argument is required and must be an element.');
      }
      this.element = element;
      this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
      this.action = false;
      this.fading = false;
      this.fulled = false;
      this.hiding = false;
      this.imageClicked = false;
      this.imageData = {};
      this.index = this.options.initialViewIndex;
      this.isImg = false;
      this.isShown = false;
      this.length = 0;
      this.moving = false;
      this.played = false;
      this.playing = false;
      this.pointers = {};
      this.ready = false;
      this.rotating = false;
      this.scaling = false;
      this.showing = false;
      this.timeout = false;
      this.tooltipping = false;
      this.viewed = false;
      this.viewing = false;
      this.wheeling = false;
      this.zooming = false;
      this.id = getUniqueID();
      this.init();
    }
    _createClass(Viewer, [{
      key: "init",
      value: function init() {
        var _this = this;
        var element = this.element,
          options = this.options;
        if (element[NAMESPACE]) {
          return;
        }
        element[NAMESPACE] = this;

        // The `focus` option requires the `keyboard` option set to `true`.
        if (options.focus && !options.keyboard) {
          options.focus = false;
        }
        var isImg = element.localName === 'img';
        var images = [];
        forEach(isImg ? [element] : element.querySelectorAll('img'), function (image) {
          if (isFunction(options.filter)) {
            if (options.filter.call(_this, image)) {
              images.push(image);
            }
          } else if (_this.getImageURL(image)) {
            images.push(image);
          }
        });
        this.isImg = isImg;
        this.length = images.length;
        this.images = images;
        this.initBody();

        // Override `transition` option if it is not supported
        if (isUndefined(document.createElement(NAMESPACE).style.transition)) {
          options.transition = false;
        }
        if (options.inline) {
          var count = 0;
          var progress = function progress() {
            count += 1;
            if (count === _this.length) {
              var timeout;
              _this.initializing = false;
              _this.delaying = {
                abort: function abort() {
                  clearTimeout(timeout);
                }
              };

              // build asynchronously to keep `this.viewer` is accessible in `ready` event handler.
              timeout = setTimeout(function () {
                _this.delaying = false;
                _this.build();
              }, 0);
            }
          };
          this.initializing = {
            abort: function abort() {
              forEach(images, function (image) {
                if (!image.complete) {
                  removeListener(image, EVENT_LOAD, progress);
                  removeListener(image, EVENT_ERROR, progress);
                }
              });
            }
          };
          forEach(images, function (image) {
            if (image.complete) {
              progress();
            } else {
              var onLoad;
              var onError;
              addListener(image, EVENT_LOAD, onLoad = function onLoad() {
                removeListener(image, EVENT_ERROR, onError);
                progress();
              }, {
                once: true
              });
              addListener(image, EVENT_ERROR, onError = function onError() {
                removeListener(image, EVENT_LOAD, onLoad);
                progress();
              }, {
                once: true
              });
            }
          });
        } else {
          addListener(element, EVENT_CLICK, this.onStart = function (_ref) {
            var target = _ref.target;
            if (target.localName === 'img' && (!isFunction(options.filter) || options.filter.call(_this, target))) {
              _this.view(_this.images.indexOf(target));
            }
          });
        }
      }
    }, {
      key: "build",
      value: function build() {
        if (this.ready) {
          return;
        }
        var element = this.element,
          options = this.options;
        var parent = element.parentNode;
        var template = document.createElement('div');
        template.innerHTML = TEMPLATE;
        var viewer = template.querySelector(".".concat(NAMESPACE, "-container"));
        var title = viewer.querySelector(".".concat(NAMESPACE, "-title"));
        var toolbar = viewer.querySelector(".".concat(NAMESPACE, "-toolbar"));
        var navbar = viewer.querySelector(".".concat(NAMESPACE, "-navbar"));
        var button = viewer.querySelector(".".concat(NAMESPACE, "-button"));
        var canvas = viewer.querySelector(".".concat(NAMESPACE, "-canvas"));
        this.parent = parent;
        this.viewer = viewer;
        this.title = title;
        this.toolbar = toolbar;
        this.navbar = navbar;
        this.button = button;
        this.canvas = canvas;
        this.footer = viewer.querySelector(".".concat(NAMESPACE, "-footer"));
        this.tooltipBox = viewer.querySelector(".".concat(NAMESPACE, "-tooltip"));
        this.player = viewer.querySelector(".".concat(NAMESPACE, "-player"));
        this.list = viewer.querySelector(".".concat(NAMESPACE, "-list"));
        viewer.id = "".concat(NAMESPACE).concat(this.id);
        title.id = "".concat(NAMESPACE, "Title").concat(this.id);
        addClass(title, !options.title ? CLASS_HIDE : getResponsiveClass(Array.isArray(options.title) ? options.title[0] : options.title));
        addClass(navbar, !options.navbar ? CLASS_HIDE : getResponsiveClass(options.navbar));
        toggleClass(button, CLASS_HIDE, !options.button);
        if (options.keyboard) {
          button.setAttribute('tabindex', 0);
        }
        if (options.backdrop) {
          addClass(viewer, "".concat(NAMESPACE, "-backdrop"));
          if (!options.inline && options.backdrop !== 'static') {
            setData(canvas, DATA_ACTION, 'hide');
          }
        }
        if (isString(options.className) && options.className) {
          // In case there are multiple class names
          options.className.split(REGEXP_SPACES).forEach(function (className) {
            addClass(viewer, className);
          });
        }
        if (options.toolbar) {
          var list = document.createElement('ul');
          var custom = isPlainObject(options.toolbar);
          var zoomButtons = BUTTONS.slice(0, 3);
          var rotateButtons = BUTTONS.slice(7, 9);
          var scaleButtons = BUTTONS.slice(9);
          if (!custom) {
            addClass(toolbar, getResponsiveClass(options.toolbar));
          }
          forEach(custom ? options.toolbar : BUTTONS, function (value, index) {
            var deep = custom && isPlainObject(value);
            var name = custom ? hyphenate(index) : value;
            var show = deep && !isUndefined(value.show) ? value.show : value;
            if (!show || !options.zoomable && zoomButtons.indexOf(name) !== -1 || !options.rotatable && rotateButtons.indexOf(name) !== -1 || !options.scalable && scaleButtons.indexOf(name) !== -1) {
              return;
            }
            var size = deep && !isUndefined(value.size) ? value.size : value;
            var click = deep && !isUndefined(value.click) ? value.click : value;
            var item = document.createElement('li');
            if (options.keyboard) {
              item.setAttribute('tabindex', 0);
            }
            item.setAttribute('role', 'button');
            addClass(item, "".concat(NAMESPACE, "-").concat(name));
            if (!isFunction(click)) {
              setData(item, DATA_ACTION, name);
            }
            if (isNumber(show)) {
              addClass(item, getResponsiveClass(show));
            }
            if (['small', 'large'].indexOf(size) !== -1) {
              addClass(item, "".concat(NAMESPACE, "-").concat(size));
            } else if (name === 'play') {
              addClass(item, "".concat(NAMESPACE, "-large"));
            }
            if (isFunction(click)) {
              addListener(item, EVENT_CLICK, click);
            }
            list.appendChild(item);
          });
          toolbar.appendChild(list);
        } else {
          addClass(toolbar, CLASS_HIDE);
        }
        if (!options.rotatable) {
          var rotates = toolbar.querySelectorAll('li[class*="rotate"]');
          addClass(rotates, CLASS_INVISIBLE);
          forEach(rotates, function (rotate) {
            toolbar.appendChild(rotate);
          });
        }
        if (options.inline) {
          addClass(button, CLASS_FULLSCREEN);
          setStyle(viewer, {
            zIndex: options.zIndexInline
          });
          if (window.getComputedStyle(parent).position === 'static') {
            setStyle(parent, {
              position: 'relative'
            });
          }
          parent.insertBefore(viewer, element.nextSibling);
        } else {
          addClass(button, CLASS_CLOSE);
          addClass(viewer, CLASS_FIXED);
          addClass(viewer, CLASS_FADE);
          addClass(viewer, CLASS_HIDE);
          setStyle(viewer, {
            zIndex: options.zIndex
          });
          var container = options.container;
          if (isString(container)) {
            container = element.ownerDocument.querySelector(container);
          }
          if (!container) {
            container = this.body;
          }
          container.appendChild(viewer);
        }
        if (options.inline) {
          this.render();
          this.bind();
          this.isShown = true;
        }
        this.ready = true;
        if (isFunction(options.ready)) {
          addListener(element, EVENT_READY, options.ready, {
            once: true
          });
        }
        if (dispatchEvent(element, EVENT_READY) === false) {
          this.ready = false;
          return;
        }
        if (this.ready && options.inline) {
          this.view(this.index);
        }
      }

      /**
       * Get the no conflict viewer class.
       * @returns {Viewer} The viewer class.
       */
    }], [{
      key: "noConflict",
      value: function noConflict() {
        window.Viewer = AnotherViewer;
        return Viewer;
      }

      /**
       * Change the default options.
       * @param {Object} options - The new default options.
       */
    }, {
      key: "setDefaults",
      value: function setDefaults(options) {
        assign(DEFAULTS, isPlainObject(options) && options);
      }
    }]);
    return Viewer;
  }();
  assign(Viewer.prototype, render, events, handlers, methods, others);

  var viewer_esm = /*#__PURE__*/Object.freeze({
    __proto__: null,
    default: Viewer
  });

  var require$$0 = /*@__PURE__*/getAugmentedNamespace(viewer_esm);

  var vue_runtime_common = {exports: {}};

  var vue_runtime_common_prod = {exports: {}};

  /*!
   * Vue.js v2.7.13
   * (c) 2014-2022 Evan You
   * Released under the MIT License.
   */

  var hasRequiredVue_runtime_common_prod;

  function requireVue_runtime_common_prod () {
  	if (hasRequiredVue_runtime_common_prod) return vue_runtime_common_prod.exports;
  	hasRequiredVue_runtime_common_prod = 1;
  const t=Object.freeze({}),e=Array.isArray;function n(t){return null==t}function o(t){return null!=t}function r(t){return !0===t}function s(t){return "string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function i(t){return "function"==typeof t}function c(t){return null!==t&&"object"==typeof t}const a=Object.prototype.toString;function l(t){return "[object Object]"===a.call(t)}function u(t){const e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function f(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function d(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===a?JSON.stringify(t,null,2):String(t)}function p(t){const e=parseFloat(t);return isNaN(e)?t:e}function h(t,e){const n=Object.create(null),o=t.split(",");for(let t=0;t<o.length;t++)n[o[t]]=!0;return e?t=>n[t.toLowerCase()]:t=>n[t]}const m=h("key,ref,slot,slot-scope,is");function _(t,e){const n=t.length;if(n){if(e===t[n-1])return void(t.length=n-1);const o=t.indexOf(e);if(o>-1)return t.splice(o,1)}}const v=Object.prototype.hasOwnProperty;function y(t,e){return v.call(t,e)}function g(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const b=/-(\w)/g,$=g((t=>t.replace(b,((t,e)=>e?e.toUpperCase():"")))),w=g((t=>t.charAt(0).toUpperCase()+t.slice(1))),C=/\B([A-Z])/g,x=g((t=>t.replace(C,"-$1").toLowerCase()));const k=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){const o=arguments.length;return o?o>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;let n=t.length-e;const o=new Array(n);for(;n--;)o[n]=t[n+e];return o}function S(t,e){for(const n in e)t[n]=e[n];return t}function A(t){const e={};for(let n=0;n<t.length;n++)t[n]&&S(e,t[n]);return e}function j(t,e,n){}const T=(t,e,n)=>!1,E=t=>t;function P(t,e){if(t===e)return !0;const n=c(t),o=c(e);if(!n||!o)return !n&&!o&&String(t)===String(e);try{const n=Array.isArray(t),o=Array.isArray(e);if(n&&o)return t.length===e.length&&t.every(((t,n)=>P(t,e[n])));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(n||o)return !1;{const n=Object.keys(t),o=Object.keys(e);return n.length===o.length&&n.every((n=>P(t[n],e[n])))}}catch(t){return !1}}function I(t,e){for(let n=0;n<t.length;n++)if(P(t[n],e))return n;return -1}function D(t){let e=!1;return function(){e||(e=!0,t.apply(this,arguments));}}function M(t,e){return t===e?0===t&&1/t!=1/e:t==t||e==e}const N=["component","directive","filter"],R=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch","renderTracked","renderTriggered"];var L={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:j,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:R};function F(t){const e=(t+"").charCodeAt(0);return 36===e||95===e}function U(t,e,n,o){Object.defineProperty(t,e,{value:n,enumerable:!!o,writable:!0,configurable:!0});}const B=new RegExp(`[^${/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/.source}.$_\\d]`);const V="__proto__"in{},z="undefined"!=typeof window,H=z&&window.navigator.userAgent.toLowerCase(),W=H&&/msie|trident/.test(H),K=H&&H.indexOf("msie 9.0")>0,q=H&&H.indexOf("edge/")>0;H&&H.indexOf("android");const G=H&&/iphone|ipad|ipod|ios/.test(H);H&&/chrome\/\d+/.test(H),H&&/phantomjs/.test(H);const Z=H&&H.match(/firefox\/(\d+)/),J={}.watch;let X,Q=!1;if(z)try{const t={};Object.defineProperty(t,"passive",{get(){Q=!0;}}),window.addEventListener("test-passive",null,t);}catch(t){}const Y=()=>(void 0===X&&(X=!z&&"undefined"!=typeof commonjsGlobal&&(commonjsGlobal.process&&"server"===commonjsGlobal.process.env.VUE_ENV)),X),tt=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function et(t){return "function"==typeof t&&/native code/.test(t.toString())}const nt="undefined"!=typeof Symbol&&et(Symbol)&&"undefined"!=typeof Reflect&&et(Reflect.ownKeys);let ot;ot="undefined"!=typeof Set&&et(Set)?Set:class{constructor(){this.set=Object.create(null);}has(t){return !0===this.set[t]}add(t){this.set[t]=!0;}clear(){this.set=Object.create(null);}};let rt=null;function st(t=null){t||rt&&rt._scope.off(),rt=t,t&&t._scope.on();}class it{constructor(t,e,n,o,r,s,i,c){this.tag=t,this.data=e,this.children=n,this.text=o,this.elm=r,this.ns=void 0,this.context=s,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=i,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=c,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1;}get child(){return this.componentInstance}}const ct=(t="")=>{const e=new it;return e.text=t,e.isComment=!0,e};function at(t){return new it(void 0,void 0,void 0,String(t))}function lt(t){const e=new it(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}let ut=0;const ft=[];class dt{constructor(){this._pending=!1,this.id=ut++,this.subs=[];}addSub(t){this.subs.push(t);}removeSub(t){this.subs[this.subs.indexOf(t)]=null,this._pending||(this._pending=!0,ft.push(this));}depend(t){dt.target&&dt.target.addDep(this);}notify(t){const e=this.subs.filter((t=>t));for(let t=0,n=e.length;t<n;t++){e[t].update();}}}dt.target=null;const pt=[];function ht(t){pt.push(t),dt.target=t;}function mt(){pt.pop(),dt.target=pt[pt.length-1];}const _t=Array.prototype,vt=Object.create(_t);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){const e=_t[t];U(vt,t,(function(...n){const o=e.apply(this,n),r=this.__ob__;let s;switch(t){case"push":case"unshift":s=n;break;case"splice":s=n.slice(2);}return s&&r.observeArray(s),r.dep.notify(),o}));}));const yt=new WeakMap;function gt(t){return bt(t,!0),U(t,"__v_isShallow",!0),t}function bt(t,e){Ct(t)||Tt(t,e,Y());}function $t(t){return Ct(t)?$t(t.__v_raw):!(!t||!t.__ob__)}function wt(t){return !(!t||!t.__v_isShallow)}function Ct(t){return !(!t||!t.__v_isReadonly)}const xt=Object.getOwnPropertyNames(vt),kt={};let Ot=!0;function St(t){Ot=t;}const At={notify:j,depend:j,addSub:j,removeSub:j};class jt{constructor(t,n=!1,o=!1){if(this.value=t,this.shallow=n,this.mock=o,this.dep=o?At:new dt,this.vmCount=0,U(t,"__ob__",this),e(t)){if(!o)if(V)t.__proto__=vt;else for(let e=0,n=xt.length;e<n;e++){const n=xt[e];U(t,n,vt[n]);}n||this.observeArray(t);}else {const e=Object.keys(t);for(let r=0;r<e.length;r++){Et(t,e[r],kt,void 0,n,o);}}}observeArray(t){for(let e=0,n=t.length;e<n;e++)Tt(t[e],!1,this.mock);}}function Tt(t,n,o){return t&&y(t,"__ob__")&&t.__ob__ instanceof jt?t.__ob__:!Ot||!o&&Y()||!e(t)&&!l(t)||!Object.isExtensible(t)||t.__v_skip||yt.has(t)||Mt(t)||t instanceof it?void 0:new jt(t,n,o)}function Et(t,n,o,r,s,i){const c=new dt,a=Object.getOwnPropertyDescriptor(t,n);if(a&&!1===a.configurable)return;const l=a&&a.get,u=a&&a.set;l&&!u||o!==kt&&2!==arguments.length||(o=t[n]);let f=!s&&Tt(o,!1,i);return Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:function(){const n=l?l.call(t):o;return dt.target&&(c.depend(),f&&(f.dep.depend(),e(n)&&Dt(n))),Mt(n)&&!s?n.value:n},set:function(e){const n=l?l.call(t):o;if(M(n,e)){if(u)u.call(t,e);else {if(l)return;if(!s&&Mt(n)&&!Mt(e))return void(n.value=e);o=e;}f=!s&&Tt(e,!1,i),c.notify();}}}),c}function Pt(t,n,o){if(Ct(t))return;const r=t.__ob__;return e(t)&&u(n)?(t.length=Math.max(t.length,n),t.splice(n,1,o),r&&!r.shallow&&r.mock&&Tt(o,!1,!0),o):n in t&&!(n in Object.prototype)?(t[n]=o,o):t._isVue||r&&r.vmCount?o:r?(Et(r.value,n,o,void 0,r.shallow,r.mock),r.dep.notify(),o):(t[n]=o,o)}function It(t,n){if(e(t)&&u(n))return void t.splice(n,1);const o=t.__ob__;t._isVue||o&&o.vmCount||Ct(t)||y(t,n)&&(delete t[n],o&&o.dep.notify());}function Dt(t){for(let n,o=0,r=t.length;o<r;o++)n=t[o],n&&n.__ob__&&n.__ob__.dep.depend(),e(n)&&Dt(n);}function Mt(t){return !(!t||!0!==t.__v_isRef)}function Nt(t,e){if(Mt(t))return t;const n={};return U(n,"__v_isRef",!0),U(n,"__v_isShallow",e),U(n,"dep",Et(n,"value",t,null,e,Y())),n}function Rt(t,e,n){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>{const t=e[n];if(Mt(t))return t.value;{const e=t&&t.__ob__;return e&&e.dep.depend(),t}},set:t=>{const o=e[n];Mt(o)&&!Mt(t)?o.value=t:e[n]=t;}});}function Lt(t,e,n){const o=t[e];if(Mt(o))return o;const r={get value(){const o=t[e];return void 0===o?n:o},set value(n){t[e]=n;}};return U(r,"__v_isRef",!0),r}const Ft=new WeakMap,Ut=new WeakMap;function Bt(t){return Vt(t,!1)}function Vt(t,e){if(!l(t))return t;if(Ct(t))return t;const n=e?Ut:Ft,o=n.get(t);if(o)return o;const r=Object.create(Object.getPrototypeOf(t));n.set(t,r),U(r,"__v_isReadonly",!0),U(r,"__v_raw",t),Mt(t)&&U(r,"__v_isRef",!0),(e||wt(t))&&U(r,"__v_isShallow",!0);const s=Object.keys(t);for(let n=0;n<s.length;n++)zt(r,t,s[n],e);return r}function zt(t,e,n,o){Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get(){const t=e[n];return o||!l(t)?t:Bt(t)},set(){}});}function Ht(t,e){return Kt(t,null,{flush:"post"})}const Wt={};function Kt(n,o,{immediate:r,deep:s,flush:c="pre",onTrack:a,onTrigger:l}=t){const u=rt,f=(t,e,n=null)=>Ne(t,null,n,u,e);let d,p,h=!1,m=!1;if(Mt(n)?(d=()=>n.value,h=wt(n)):$t(n)?(d=()=>(n.__ob__.dep.depend(),n),s=!0):e(n)?(m=!0,h=n.some((t=>$t(t)||wt(t))),d=()=>n.map((t=>Mt(t)?t.value:$t(t)?cn(t):i(t)?f(t,"watcher getter"):void 0))):d=i(n)?o?()=>f(n,"watcher getter"):()=>{if(!u||!u._isDestroyed)return p&&p(),f(n,"watcher",[_])}:j,o&&s){const t=d;d=()=>cn(t());}let _=t=>{p=v.onStop=()=>{f(t,"watcher cleanup");};};if(Y())return _=j,o?r&&f(o,"watcher callback",[d(),m?[]:void 0,_]):d(),j;const v=new fn(rt,d,j,{lazy:!0});v.noRecurse=!o;let y=m?[]:Wt;return v.run=()=>{if(v.active)if(o){const t=v.get();(s||h||(m?t.some(((t,e)=>M(t,y[e]))):M(t,y)))&&(p&&p(),f(o,"watcher callback",[t,y===Wt?void 0:y,_]),y=t);}else v.get();},"sync"===c?v.update=v.run:"post"===c?(v.post=!0,v.update=()=>Pn(v)):v.update=()=>{if(u&&u===rt&&!u._isMounted){const t=u._preWatchers||(u._preWatchers=[]);t.indexOf(v)<0&&t.push(v);}else Pn(v);},o?r?v.run():y=v.get():"post"===c&&u?u.$once("hook:mounted",(()=>v.get())):v.get(),()=>{v.teardown();}}let qt;class Gt{constructor(t=!1){this.detached=t,this.active=!0,this.effects=[],this.cleanups=[],this.parent=qt,!t&&qt&&(this.index=(qt.scopes||(qt.scopes=[])).push(this)-1);}run(t){if(this.active){const e=qt;try{return qt=this,t()}finally{qt=e;}}}on(){qt=this;}off(){qt=this.parent;}stop(t){if(this.active){let e,n;for(e=0,n=this.effects.length;e<n;e++)this.effects[e].teardown();for(e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index);}this.parent=void 0,this.active=!1;}}}function Zt(t){const e=t._provided,n=t.$parent&&t.$parent._provided;return n===e?t._provided=Object.create(n):e}const Jt=g((t=>{const e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),o="!"===(t=n?t.slice(1):t).charAt(0);return {name:t=o?t.slice(1):t,once:n,capture:o,passive:e}}));function Xt(t,n){function o(){const t=o.fns;if(!e(t))return Ne(t,null,arguments,n,"v-on handler");{const e=t.slice();for(let t=0;t<e.length;t++)Ne(e[t],null,arguments,n,"v-on handler");}}return o.fns=t,o}function Qt(t,e,o,s,i,c){let a,l,u,f;for(a in t)l=t[a],u=e[a],f=Jt(a),n(l)||(n(u)?(n(l.fns)&&(l=t[a]=Xt(l,c)),r(f.once)&&(l=t[a]=i(f.name,l,f.capture)),o(f.name,l,f.capture,f.passive,f.params)):l!==u&&(u.fns=l,t[a]=u));for(a in e)n(t[a])&&(f=Jt(a),s(f.name,e[a],f.capture));}function Yt(t,e,s){let i;t instanceof it&&(t=t.data.hook||(t.data.hook={}));const c=t[e];function a(){s.apply(this,arguments),_(i.fns,a);}n(c)?i=Xt([a]):o(c.fns)&&r(c.merged)?(i=c,i.fns.push(a)):i=Xt([c,a]),i.merged=!0,t[e]=i;}function te(t,e,n,r,s){if(o(e)){if(y(e,n))return t[n]=e[n],s||delete e[n],!0;if(y(e,r))return t[n]=e[r],s||delete e[r],!0}return !1}function ee(t){return s(t)?[at(t)]:e(t)?oe(t):void 0}function ne(t){return o(t)&&o(t.text)&&!1===t.isComment}function oe(t,i){const c=[];let a,l,u,f;for(a=0;a<t.length;a++)l=t[a],n(l)||"boolean"==typeof l||(u=c.length-1,f=c[u],e(l)?l.length>0&&(l=oe(l,`${i||""}_${a}`),ne(l[0])&&ne(f)&&(c[u]=at(f.text+l[0].text),l.shift()),c.push.apply(c,l)):s(l)?ne(f)?c[u]=at(f.text+l):""!==l&&c.push(at(l)):ne(l)&&ne(f)?c[u]=at(f.text+l.text):(r(t._isVList)&&o(l.tag)&&n(l.key)&&o(i)&&(l.key=`__vlist${i}_${a}__`),c.push(l)));return c}function re(t,n){let r,s,i,a,l=null;if(e(t)||"string"==typeof t)for(l=new Array(t.length),r=0,s=t.length;r<s;r++)l[r]=n(t[r],r);else if("number"==typeof t)for(l=new Array(t),r=0;r<t;r++)l[r]=n(r+1,r);else if(c(t))if(nt&&t[Symbol.iterator]){l=[];const e=t[Symbol.iterator]();let o=e.next();for(;!o.done;)l.push(n(o.value,l.length)),o=e.next();}else for(i=Object.keys(t),l=new Array(i.length),r=0,s=i.length;r<s;r++)a=i[r],l[r]=n(t[a],a,r);return o(l)||(l=[]),l._isVList=!0,l}function se(t,e,n,o){const r=this.$scopedSlots[t];let s;r?(n=n||{},o&&(n=S(S({},o),n)),s=r(n)||(i(e)?e():e)):s=this.$slots[t]||(i(e)?e():e);const c=n&&n.slot;return c?this.$createElement("template",{slot:c},s):s}function ie(t){return Jn(this.$options,"filters",t)||E}function ce(t,n){return e(t)?-1===t.indexOf(n):t!==n}function ae(t,e,n,o,r){const s=L.keyCodes[e]||n;return r&&o&&!L.keyCodes[e]?ce(r,o):s?ce(s,t):o?x(o)!==e:void 0===t}function le(t,n,o,r,s){if(o)if(c(o)){let i;e(o)&&(o=A(o));for(const e in o){if("class"===e||"style"===e||m(e))i=t;else {const o=t.attrs&&t.attrs.type;i=r||L.mustUseProp(n,o,e)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={});}const c=$(e),a=x(e);if(!(c in i)&&!(a in i)&&(i[e]=o[e],s)){(t.on||(t.on={}))[`update:${e}`]=function(t){o[e]=t;};}}}return t}function ue(t,e){const n=this._staticTrees||(this._staticTrees=[]);let o=n[t];return o&&!e||(o=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,this._c,this),de(o,`__static__${t}`,!1)),o}function fe(t,e,n){return de(t,`__once__${e}${n?`_${n}`:""}`,!0),t}function de(t,n,o){if(e(t))for(let e=0;e<t.length;e++)t[e]&&"string"!=typeof t[e]&&pe(t[e],`${n}_${e}`,o);else pe(t,n,o);}function pe(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n;}function he(t,e){if(e)if(l(e)){const n=t.on=t.on?S({},t.on):{};for(const t in e){const o=n[t],r=e[t];n[t]=o?[].concat(o,r):r;}}return t}function me(t,n,o,r){n=n||{$stable:!o};for(let r=0;r<t.length;r++){const s=t[r];e(s)?me(s,n,o):s&&(s.proxy&&(s.fn.proxy=!0),n[s.key]=s.fn);}return r&&(n.$key=r),n}function _e(t,e){for(let n=0;n<e.length;n+=2){const o=e[n];"string"==typeof o&&o&&(t[e[n]]=e[n+1]);}return t}function ve(t,e){return "string"==typeof t?e+t:t}function ye(t){t._o=fe,t._n=p,t._s=d,t._l=re,t._t=se,t._q=P,t._i=I,t._m=ue,t._f=ie,t._k=ae,t._b=le,t._v=at,t._e=ct,t._u=me,t._g=he,t._d=_e,t._p=ve;}function ge(t,e){if(!t||!t.length)return {};const n={};for(let o=0,r=t.length;o<r;o++){const r=t[o],s=r.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,r.context!==e&&r.fnContext!==e||!s||null==s.slot)(n.default||(n.default=[])).push(r);else {const t=s.slot,e=n[t]||(n[t]=[]);"template"===r.tag?e.push.apply(e,r.children||[]):e.push(r);}}for(const t in n)n[t].every(be)&&delete n[t];return n}function be(t){return t.isComment&&!t.asyncFactory||" "===t.text}function $e(t){return t.isComment&&t.asyncFactory}function we(e,n,o,r){let s;const i=Object.keys(o).length>0,c=n?!!n.$stable:!i,a=n&&n.$key;if(n){if(n._normalized)return n._normalized;if(c&&r&&r!==t&&a===r.$key&&!i&&!r.$hasNormal)return r;s={};for(const t in n)n[t]&&"$"!==t[0]&&(s[t]=Ce(e,o,t,n[t]));}else s={};for(const t in o)t in s||(s[t]=xe(o,t));return n&&Object.isExtensible(n)&&(n._normalized=s),U(s,"$stable",c),U(s,"$key",a),U(s,"$hasNormal",i),s}function Ce(t,n,o,r){const s=function(){const n=rt;st(t);let o=arguments.length?r.apply(null,arguments):r({});o=o&&"object"==typeof o&&!e(o)?[o]:ee(o);const s=o&&o[0];return st(n),o&&(!s||1===o.length&&s.isComment&&!$e(s))?void 0:o};return r.proxy&&Object.defineProperty(n,o,{get:s,enumerable:!0,configurable:!0}),s}function xe(t,e){return ()=>t[e]}function ke(e){return {get attrs(){if(!e._attrsProxy){const n=e._attrsProxy={};U(n,"_v_attr_proxy",!0),Oe(n,e.$attrs,t,e,"$attrs");}return e._attrsProxy},get listeners(){if(!e._listenersProxy){Oe(e._listenersProxy={},e.$listeners,t,e,"$listeners");}return e._listenersProxy},get slots(){return function(t){t._slotsProxy||Ae(t._slotsProxy={},t.$scopedSlots);return t._slotsProxy}(e)},emit:k(e.$emit,e),expose(t){t&&Object.keys(t).forEach((n=>Rt(e,t,n)));}}}function Oe(t,e,n,o,r){let s=!1;for(const i in e)i in t?e[i]!==n[i]&&(s=!0):(s=!0,Se(t,i,o,r));for(const n in t)n in e||(s=!0,delete t[n]);return s}function Se(t,e,n,o){Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:()=>n[o][e]});}function Ae(t,e){for(const n in e)t[n]=e[n];for(const n in t)n in e||delete t[n];}function je(){const t=rt;return t._setupContext||(t._setupContext=ke(t))}let Te=null;function Ee(t,e){return (t.__esModule||nt&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function Pe(t){if(e(t))for(let e=0;e<t.length;e++){const n=t[e];if(o(n)&&(o(n.componentOptions)||$e(n)))return n}}function Ie(t,n,a,l,u,f){return (e(a)||s(a))&&(u=l,l=a,a=void 0),r(f)&&(u=2),function(t,n,r,s,a){if(o(r)&&o(r.__ob__))return ct();o(r)&&o(r.is)&&(n=r.is);if(!n)return ct();e(s)&&i(s[0])&&((r=r||{}).scopedSlots={default:s[0]},s.length=0);2===a?s=ee(s):1===a&&(s=function(t){for(let n=0;n<t.length;n++)if(e(t[n]))return Array.prototype.concat.apply([],t);return t}(s));let l,u;if("string"==typeof n){let e;u=t.$vnode&&t.$vnode.ns||L.getTagNamespace(n),l=L.isReservedTag(n)?new it(L.parsePlatformTagName(n),r,s,void 0,void 0,t):r&&r.pre||!o(e=Jn(t.$options,"components",n))?new it(n,r,s,void 0,void 0,t):Un(e,r,t,s,n);}else l=Un(n,r,t,s);return e(l)?l:o(l)?(o(u)&&De(l,u),o(r)&&function(t){c(t.style)&&cn(t.style);c(t.class)&&cn(t.class);}(r),l):ct()}(t,n,a,l,u)}function De(t,e,s){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,s=!0),o(t.children))for(let i=0,c=t.children.length;i<c;i++){const c=t.children[i];o(c.tag)&&(n(c.ns)||r(s)&&"svg"!==c.tag)&&De(c,e,s);}}function Me(t,e,n){ht();try{if(e){let o=e;for(;o=o.$parent;){const r=o.$options.errorCaptured;if(r)for(let s=0;s<r.length;s++)try{if(!1===r[s].call(o,t,e,n))return}catch(t){Re(t,o,"errorCaptured hook");}}}Re(t,e,n);}finally{mt();}}function Ne(t,e,n,o,r){let s;try{s=n?t.apply(e,n):t.call(e),s&&!s._isVue&&f(s)&&!s._handled&&(s.catch((t=>Me(t,o,r+" (Promise/async)"))),s._handled=!0);}catch(t){Me(t,o,r);}return s}function Re(t,e,n){if(L.errorHandler)try{return L.errorHandler.call(null,t,e,n)}catch(e){e!==t&&Le(e);}Le(t);}function Le(t,e,n){if(!z||"undefined"==typeof console)throw t;console.error(t);}let Fe=!1;const Ue=[];let Be,Ve=!1;function ze(){Ve=!1;const t=Ue.slice(0);Ue.length=0;for(let e=0;e<t.length;e++)t[e]();}if("undefined"!=typeof Promise&&et(Promise)){const t=Promise.resolve();Be=()=>{t.then(ze),G&&setTimeout(j);},Fe=!0;}else if(W||"undefined"==typeof MutationObserver||!et(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Be="undefined"!=typeof setImmediate&&et(setImmediate)?()=>{setImmediate(ze);}:()=>{setTimeout(ze,0);};else {let t=1;const e=new MutationObserver(ze),n=document.createTextNode(String(t));e.observe(n,{characterData:!0}),Be=()=>{t=(t+1)%2,n.data=String(t);},Fe=!0;}function He(t,e){let n;if(Ue.push((()=>{if(t)try{t.call(e);}catch(t){Me(t,e,"nextTick");}else n&&n(e);})),Ve||(Ve=!0,Be()),!t&&"undefined"!=typeof Promise)return new Promise((t=>{n=t;}))}function We(t){return (e,n=rt)=>{if(n)return function(t,e,n){const o=t.$options;o[e]=Kn(o[e],n);}(n,t,e)}}const Ke=We("beforeMount"),qe=We("mounted"),Ge=We("beforeUpdate"),Ze=We("updated"),Je=We("beforeDestroy"),Xe=We("destroyed"),Qe=We("activated"),Ye=We("deactivated"),tn=We("serverPrefetch"),en=We("renderTracked"),nn=We("renderTriggered"),on=We("errorCaptured");var rn=Object.freeze({__proto__:null,version:"2.7.13",defineComponent:function(t){return t},ref:function(t){return Nt(t,!1)},shallowRef:function(t){return Nt(t,!0)},isRef:Mt,toRef:Lt,toRefs:function(t){const n=e(t)?new Array(t.length):{};for(const e in t)n[e]=Lt(t,e);return n},unref:function(t){return Mt(t)?t.value:t},proxyRefs:function(t){if($t(t))return t;const e={},n=Object.keys(t);for(let o=0;o<n.length;o++)Rt(e,t,n[o]);return e},customRef:function(t){const e=new dt,{get:n,set:o}=t((()=>{e.depend();}),(()=>{e.notify();})),r={get value(){return n()},set value(t){o(t);}};return U(r,"__v_isRef",!0),r},triggerRef:function(t){t.dep&&t.dep.notify();},reactive:function(t){return bt(t,!1),t},isReactive:$t,isReadonly:Ct,isShallow:wt,isProxy:function(t){return $t(t)||Ct(t)},shallowReactive:gt,markRaw:function(t){return c(t)&&yt.set(t,!0),t},toRaw:function t(e){const n=e&&e.__v_raw;return n?t(n):e},readonly:Bt,shallowReadonly:function(t){return Vt(t,!0)},computed:function(t,e){let n,o;const r=i(t);r?(n=t,o=j):(n=t.get,o=t.set);const s=Y()?null:new fn(rt,n,j,{lazy:!0}),c={effect:s,get value(){return s?(s.dirty&&s.evaluate(),dt.target&&s.depend(),s.value):n()},set value(t){o(t);}};return U(c,"__v_isRef",!0),U(c,"__v_isReadonly",r),c},watch:function(t,e,n){return Kt(t,e,n)},watchEffect:function(t,e){return Kt(t,null,e)},watchPostEffect:Ht,watchSyncEffect:function(t,e){return Kt(t,null,{flush:"sync"})},EffectScope:Gt,effectScope:function(t){return new Gt(t)},onScopeDispose:function(t){qt&&qt.cleanups.push(t);},getCurrentScope:function(){return qt},provide:function(t,e){rt&&(Zt(rt)[t]=e);},inject:function(t,e,n=!1){const o=rt;if(o){const r=o.$parent&&o.$parent._provided;if(r&&t in r)return r[t];if(arguments.length>1)return n&&i(e)?e.call(o):e}},h:function(t,e,n){return Ie(rt,t,e,n,2,!0)},getCurrentInstance:function(){return rt&&{proxy:rt}},useSlots:function(){return je().slots},useAttrs:function(){return je().attrs},useListeners:function(){return je().listeners},mergeDefaults:function(t,n){const o=e(t)?t.reduce(((t,e)=>(t[e]={},t)),{}):t;for(const t in n){const r=o[t];r?e(r)||i(r)?o[t]={type:r,default:n[t]}:r.default=n[t]:null===r&&(o[t]={default:n[t]});}return o},nextTick:He,set:Pt,del:It,useCssModule:function(e="$style"){{if(!rt)return t;const n=rt[e];return n||t}},useCssVars:function(t){if(!z)return;const e=rt;e&&Ht((()=>{const n=e.$el,o=t(e,e._setupProxy);if(n&&1===n.nodeType){const t=n.style;for(const e in o)t.setProperty(`--${e}`,o[e]);}}));},defineAsyncComponent:function(t){i(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:o,delay:r=200,timeout:s,suspensible:c=!1,onError:a}=t;let l=null,u=0;const f=()=>{let t;return l||(t=l=e().catch((t=>{if(t=t instanceof Error?t:new Error(String(t)),a)return new Promise(((e,n)=>{a(t,(()=>e((u++,l=null,f()))),(()=>n(t)),u+1);}));throw t})).then((e=>t!==l&&l?l:(e&&(e.__esModule||"Module"===e[Symbol.toStringTag])&&(e=e.default),e))))};return ()=>({component:f(),delay:r,timeout:s,error:o,loading:n})},onBeforeMount:Ke,onMounted:qe,onBeforeUpdate:Ge,onUpdated:Ze,onBeforeUnmount:Je,onUnmounted:Xe,onActivated:Qe,onDeactivated:Ye,onServerPrefetch:tn,onRenderTracked:en,onRenderTriggered:nn,onErrorCaptured:function(t,e=rt){on(t,e);}});const sn=new ot;function cn(t){return an(t,sn),sn.clear(),t}function an(t,n){let o,r;const s=e(t);if(!(!s&&!c(t)||t.__v_skip||Object.isFrozen(t)||t instanceof it)){if(t.__ob__){const e=t.__ob__.dep.id;if(n.has(e))return;n.add(e);}if(s)for(o=t.length;o--;)an(t[o],n);else if(Mt(t))an(t.value,n);else for(r=Object.keys(t),o=r.length;o--;)an(t[r[o]],n);}}let ln,un=0;class fn{constructor(t,e,n,o,r){!function(t,e=qt){e&&e.active&&e.effects.push(t);}(this,qt&&!qt._vm?qt:t?t._scope:void 0),(this.vm=t)&&r&&(t._watcher=this),o?(this.deep=!!o.deep,this.user=!!o.user,this.lazy=!!o.lazy,this.sync=!!o.sync,this.before=o.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++un,this.active=!0,this.post=!1,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ot,this.newDepIds=new ot,this.expression="",i(e)?this.getter=e:(this.getter=function(t){if(B.test(t))return;const e=t.split(".");return function(t){for(let n=0;n<e.length;n++){if(!t)return;t=t[e[n]];}return t}}(e),this.getter||(this.getter=j)),this.value=this.lazy?void 0:this.get();}get(){let t;ht(this);const e=this.vm;try{t=this.getter.call(e,e);}catch(t){if(!this.user)throw t;Me(t,e,`getter for watcher "${this.expression}"`);}finally{this.deep&&cn(t),mt(),this.cleanupDeps();}return t}addDep(t){const e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this));}cleanupDeps(){let t=this.deps.length;for(;t--;){const e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this);}let e=this.depIds;this.depIds=this.newDepIds,this.newDepIds=e,this.newDepIds.clear(),e=this.deps,this.deps=this.newDeps,this.newDeps=e,this.newDeps.length=0;}update(){this.lazy?this.dirty=!0:this.sync?this.run():Pn(this);}run(){if(this.active){const t=this.get();if(t!==this.value||c(t)||this.deep){const e=this.value;if(this.value=t,this.user){const n=`callback for watcher "${this.expression}"`;Ne(this.cb,this.vm,[t,e],this.vm,n);}else this.cb.call(this.vm,t,e);}}}evaluate(){this.value=this.get(),this.dirty=!1;}depend(){let t=this.deps.length;for(;t--;)this.deps[t].depend();}teardown(){if(this.vm&&!this.vm._isBeingDestroyed&&_(this.vm._scope.effects,this),this.active){let t=this.deps.length;for(;t--;)this.deps[t].removeSub(this);this.active=!1,this.onStop&&this.onStop();}}}function dn(t,e){ln.$on(t,e);}function pn(t,e){ln.$off(t,e);}function hn(t,e){const n=ln;return function o(){const r=e.apply(null,arguments);null!==r&&n.$off(t,o);}}function mn(t,e,n){ln=t,Qt(e,n||{},dn,pn,hn,t),ln=void 0;}let _n=null;function vn(t){const e=_n;return _n=t,()=>{_n=e;}}function yn(t){for(;t&&(t=t.$parent);)if(t._inactive)return !0;return !1}function gn(t,e){if(e){if(t._directInactive=!1,yn(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(let e=0;e<t.$children.length;e++)gn(t.$children[e]);$n(t,"activated");}}function bn(t,e){if(!(e&&(t._directInactive=!0,yn(t))||t._inactive)){t._inactive=!0;for(let e=0;e<t.$children.length;e++)bn(t.$children[e]);$n(t,"deactivated");}}function $n(t,e,n,o=!0){ht();const r=rt;o&&st(t);const s=t.$options[e],i=`${e} hook`;if(s)for(let e=0,o=s.length;e<o;e++)Ne(s[e],t,n||null,t,i);t._hasHookEvent&&t.$emit("hook:"+e),o&&st(r),mt();}const wn=[],Cn=[];let xn={},kn=!1,On=!1,Sn=0;let An=0,jn=Date.now;if(z&&!W){const t=window.performance;t&&"function"==typeof t.now&&jn()>document.createEvent("Event").timeStamp&&(jn=()=>t.now());}const Tn=(t,e)=>{if(t.post){if(!e.post)return 1}else if(e.post)return -1;return t.id-e.id};function En(){let t,e;for(An=jn(),On=!0,wn.sort(Tn),Sn=0;Sn<wn.length;Sn++)t=wn[Sn],t.before&&t.before(),e=t.id,xn[e]=null,t.run();const n=Cn.slice(),o=wn.slice();Sn=wn.length=Cn.length=0,xn={},kn=On=!1,function(t){for(let e=0;e<t.length;e++)t[e]._inactive=!0,gn(t[e],!0);}(n),function(t){let e=t.length;for(;e--;){const n=t[e],o=n.vm;o&&o._watcher===n&&o._isMounted&&!o._isDestroyed&&$n(o,"updated");}}(o),(()=>{for(let t=0;t<ft.length;t++){const e=ft[t];e.subs=e.subs.filter((t=>t)),e._pending=!1;}ft.length=0;})(),tt&&L.devtools&&tt.emit("flush");}function Pn(t){const e=t.id;if(null==xn[e]&&(t!==dt.target||!t.noRecurse)){if(xn[e]=!0,On){let e=wn.length-1;for(;e>Sn&&wn[e].id>t.id;)e--;wn.splice(e+1,0,t);}else wn.push(t);kn||(kn=!0,He(En));}}function In(t,e){if(t){const n=Object.create(null),o=nt?Reflect.ownKeys(t):Object.keys(t);for(let r=0;r<o.length;r++){const s=o[r];if("__ob__"===s)continue;const c=t[s].from;if(c in e._provided)n[s]=e._provided[c];else if("default"in t[s]){const o=t[s].default;n[s]=i(o)?o.call(e):o;}}return n}}function Dn(n,o,s,i,c){const a=c.options;let l;y(i,"_uid")?(l=Object.create(i),l._original=i):(l=i,i=i._original);const u=r(a._compiled),f=!u;this.data=n,this.props=o,this.children=s,this.parent=i,this.listeners=n.on||t,this.injections=In(a.inject,i),this.slots=()=>(this.$slots||we(i,n.scopedSlots,this.$slots=ge(s,i)),this.$slots),Object.defineProperty(this,"scopedSlots",{enumerable:!0,get(){return we(i,n.scopedSlots,this.slots())}}),u&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=we(i,n.scopedSlots,this.$slots)),a._scopeId?this._c=(t,n,o,r)=>{const s=Ie(l,t,n,o,r,f);return s&&!e(s)&&(s.fnScopeId=a._scopeId,s.fnContext=i),s}:this._c=(t,e,n,o)=>Ie(l,t,e,n,o,f);}function Mn(t,e,n,o,r){const s=lt(t);return s.fnContext=n,s.fnOptions=o,e.slot&&((s.data||(s.data={})).slot=e.slot),s}function Nn(t,e){for(const n in e)t[$(n)]=e[n];}function Rn(t){return t.name||t.__name||t._componentTag}ye(Dn.prototype);const Ln={init(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){const e=t;Ln.prepatch(e,e);}else {(t.componentInstance=function(t,e){const n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;o(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,_n)).$mount(e?t.elm:void 0,e);}},prepatch(e,n){const o=n.componentOptions;!function(e,n,o,r,s){const i=r.data.scopedSlots,c=e.$scopedSlots,a=!!(i&&!i.$stable||c!==t&&!c.$stable||i&&e.$scopedSlots.$key!==i.$key||!i&&e.$scopedSlots.$key);let l=!!(s||e.$options._renderChildren||a);const u=e.$vnode;e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=s;const f=r.data.attrs||t;e._attrsProxy&&Oe(e._attrsProxy,f,u.data&&u.data.attrs||t,e,"$attrs")&&(l=!0),e.$attrs=f,o=o||t;const d=e.$options._parentListeners;if(e._listenersProxy&&Oe(e._listenersProxy,o,d||t,e,"$listeners"),e.$listeners=e.$options._parentListeners=o,mn(e,o,d),n&&e.$options.props){St(!1);const t=e._props,o=e.$options._propKeys||[];for(let r=0;r<o.length;r++){const s=o[r],i=e.$options.props;t[s]=Xn(s,i,n,e);}St(!0),e.$options.propsData=n;}l&&(e.$slots=ge(s,r.context),e.$forceUpdate());}(n.componentInstance=e.componentInstance,o.propsData,o.listeners,n,o.children);},insert(t){const{context:e,componentInstance:n}=t;var o;n._isMounted||(n._isMounted=!0,$n(n,"mounted")),t.data.keepAlive&&(e._isMounted?((o=n)._inactive=!1,Cn.push(o)):gn(n,!0));},destroy(t){const{componentInstance:e}=t;e._isDestroyed||(t.data.keepAlive?bn(e,!0):e.$destroy());}},Fn=Object.keys(Ln);function Un(s,i,a,l,u){if(n(s))return;const d=a.$options._base;if(c(s)&&(s=d.extend(s)),"function"!=typeof s)return;let p;if(n(s.cid)&&(p=s,s=function(t,e){if(r(t.error)&&o(t.errorComp))return t.errorComp;if(o(t.resolved))return t.resolved;const s=Te;if(s&&o(t.owners)&&-1===t.owners.indexOf(s)&&t.owners.push(s),r(t.loading)&&o(t.loadingComp))return t.loadingComp;if(s&&!o(t.owners)){const r=t.owners=[s];let i=!0,a=null,l=null;s.$on("hook:destroyed",(()=>_(r,s)));const u=t=>{for(let t=0,e=r.length;t<e;t++)r[t].$forceUpdate();t&&(r.length=0,null!==a&&(clearTimeout(a),a=null),null!==l&&(clearTimeout(l),l=null));},d=D((n=>{t.resolved=Ee(n,e),i?r.length=0:u(!0);})),p=D((e=>{o(t.errorComp)&&(t.error=!0,u(!0));})),h=t(d,p);return c(h)&&(f(h)?n(t.resolved)&&h.then(d,p):f(h.component)&&(h.component.then(d,p),o(h.error)&&(t.errorComp=Ee(h.error,e)),o(h.loading)&&(t.loadingComp=Ee(h.loading,e),0===h.delay?t.loading=!0:a=setTimeout((()=>{a=null,n(t.resolved)&&n(t.error)&&(t.loading=!0,u(!1));}),h.delay||200)),o(h.timeout)&&(l=setTimeout((()=>{l=null,n(t.resolved)&&p(null);}),h.timeout)))),i=!1,t.loading?t.loadingComp:t.resolved}}(p,d),void 0===s))return function(t,e,n,o,r){const s=ct();return s.asyncFactory=t,s.asyncMeta={data:e,context:n,children:o,tag:r},s}(p,i,a,l,u);i=i||{},fo(s),o(i.model)&&function(t,n){const r=t.model&&t.model.prop||"value",s=t.model&&t.model.event||"input";(n.attrs||(n.attrs={}))[r]=n.model.value;const i=n.on||(n.on={}),c=i[s],a=n.model.callback;o(c)?(e(c)?-1===c.indexOf(a):c!==a)&&(i[s]=[a].concat(c)):i[s]=a;}(s.options,i);const h=function(t,e,r){const s=e.options.props;if(n(s))return;const i={},{attrs:c,props:a}=t;if(o(c)||o(a))for(const t in s){const e=x(t);te(i,a,t,e,!0)||te(i,c,t,e,!1);}return i}(i,s);if(r(s.options.functional))return function(n,r,s,i,c){const a=n.options,l={},u=a.props;if(o(u))for(const e in u)l[e]=Xn(e,u,r||t);else o(s.attrs)&&Nn(l,s.attrs),o(s.props)&&Nn(l,s.props);const f=new Dn(s,l,c,i,n),d=a.render.call(null,f._c,f);if(d instanceof it)return Mn(d,s,f.parent,a);if(e(d)){const t=ee(d)||[],e=new Array(t.length);for(let n=0;n<t.length;n++)e[n]=Mn(t[n],s,f.parent,a);return e}}(s,h,i,a,l);const m=i.on;if(i.on=i.nativeOn,r(s.options.abstract)){const t=i.slot;i={},t&&(i.slot=t);}!function(t){const e=t.hook||(t.hook={});for(let t=0;t<Fn.length;t++){const n=Fn[t],o=e[n],r=Ln[n];o===r||o&&o._merged||(e[n]=o?Bn(r,o):r);}}(i);const v=Rn(s.options)||u;return new it(`vue-component-${s.cid}${v?`-${v}`:""}`,i,void 0,void 0,void 0,a,{Ctor:s,propsData:h,listeners:m,tag:u,children:l},p)}function Bn(t,e){const n=(n,o)=>{t(n,o),e(n,o);};return n._merged=!0,n}let Vn=j;const zn=L.optionMergeStrategies;function Hn(t,e){if(!e)return t;let n,o,r;const s=nt?Reflect.ownKeys(e):Object.keys(e);for(let i=0;i<s.length;i++)n=s[i],"__ob__"!==n&&(o=t[n],r=e[n],y(t,n)?o!==r&&l(o)&&l(r)&&Hn(o,r):Pt(t,n,r));return t}function Wn(t,e,n){return n?function(){const o=i(e)?e.call(n,n):e,r=i(t)?t.call(n,n):t;return o?Hn(o,r):r}:e?t?function(){return Hn(i(e)?e.call(this,this):e,i(t)?t.call(this,this):t)}:e:t}function Kn(t,n){const o=n?t?t.concat(n):e(n)?n:[n]:t;return o?function(t){const e=[];for(let n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(o):o}function qn(t,e,n,o){const r=Object.create(t||null);return e?S(r,e):r}zn.data=function(t,e,n){return n?Wn(t,e,n):e&&"function"!=typeof e?t:Wn(t,e)},R.forEach((t=>{zn[t]=Kn;})),N.forEach((function(t){zn[t+"s"]=qn;})),zn.watch=function(t,n,o,r){if(t===J&&(t=void 0),n===J&&(n=void 0),!n)return Object.create(t||null);if(!t)return n;const s={};S(s,t);for(const t in n){let o=s[t];const r=n[t];o&&!e(o)&&(o=[o]),s[t]=o?o.concat(r):e(r)?r:[r];}return s},zn.props=zn.methods=zn.inject=zn.computed=function(t,e,n,o){if(!t)return e;const r=Object.create(null);return S(r,t),e&&S(r,e),r},zn.provide=Wn;const Gn=function(t,e){return void 0===e?t:e};function Zn(t,n,o){if(i(n)&&(n=n.options),function(t,n){const o=t.props;if(!o)return;const r={};let s,i,c;if(e(o))for(s=o.length;s--;)i=o[s],"string"==typeof i&&(c=$(i),r[c]={type:null});else if(l(o))for(const t in o)i=o[t],c=$(t),r[c]=l(i)?i:{type:i};t.props=r;}(n),function(t,n){const o=t.inject;if(!o)return;const r=t.inject={};if(e(o))for(let t=0;t<o.length;t++)r[o[t]]={from:o[t]};else if(l(o))for(const t in o){const e=o[t];r[t]=l(e)?S({from:t},e):{from:e};}}(n),function(t){const e=t.directives;if(e)for(const t in e){const n=e[t];i(n)&&(e[t]={bind:n,update:n});}}(n),!n._base&&(n.extends&&(t=Zn(t,n.extends,o)),n.mixins))for(let e=0,r=n.mixins.length;e<r;e++)t=Zn(t,n.mixins[e],o);const r={};let s;for(s in t)c(s);for(s in n)y(t,s)||c(s);function c(e){const s=zn[e]||Gn;r[e]=s(t[e],n[e],o,e);}return r}function Jn(t,e,n,o){if("string"!=typeof n)return;const r=t[e];if(y(r,n))return r[n];const s=$(n);if(y(r,s))return r[s];const i=w(s);if(y(r,i))return r[i];return r[n]||r[s]||r[i]}function Xn(t,e,n,o){const r=e[t],s=!y(n,t);let c=n[t];const a=eo(Boolean,r.type);if(a>-1)if(s&&!y(r,"default"))c=!1;else if(""===c||c===x(t)){const t=eo(String,r.type);(t<0||a<t)&&(c=!0);}if(void 0===c){c=function(t,e,n){if(!y(e,"default"))return;const o=e.default;if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return i(o)&&"Function"!==Yn(e.type)?o.call(t):o}(o,r,t);const e=Ot;St(!0),Tt(c),St(e);}return c}const Qn=/^\s*function (\w+)/;function Yn(t){const e=t&&t.toString().match(Qn);return e?e[1]:""}function to(t,e){return Yn(t)===Yn(e)}function eo(t,n){if(!e(n))return to(n,t)?0:-1;for(let e=0,o=n.length;e<o;e++)if(to(n[e],t))return e;return -1}const no={enumerable:!0,configurable:!0,get:j,set:j};function oo(t,e,n){no.get=function(){return this[e][n]},no.set=function(t){this[e][n]=t;},Object.defineProperty(t,n,no);}function ro(t){const n=t.$options;if(n.props&&function(t,e){const n=t.$options.propsData||{},o=t._props=gt({}),r=t.$options._propKeys=[];t.$parent&&St(!1);for(const s in e){r.push(s);Et(o,s,Xn(s,e,n,t)),s in t||oo(t,"_props",s);}St(!0);}(t,n.props),function(t){const e=t.$options,n=e.setup;if(n){const o=t._setupContext=ke(t);st(t),ht();const r=Ne(n,null,[t._props||gt({}),o],t,"setup");if(mt(),st(),i(r))e.render=r;else if(c(r))if(t._setupState=r,r.__sfc){const e=t._setupProxy={};for(const t in r)"__sfc"!==t&&Rt(e,r,t);}else for(const e in r)F(e)||Rt(t,r,e);}}(t),n.methods&&function(t,e){t.$options.props;for(const n in e)t[n]="function"!=typeof e[n]?j:k(e[n],t);}(t,n.methods),n.data)!function(t){let e=t.$options.data;e=t._data=i(e)?function(t,e){ht();try{return t.call(e,e)}catch(t){return Me(t,e,"data()"),{}}finally{mt();}}(e,t):e||{},l(e)||(e={});const n=Object.keys(e),o=t.$options.props;t.$options.methods;let r=n.length;for(;r--;){const e=n[r];o&&y(o,e)||F(e)||oo(t,"_data",e);}const s=Tt(e);s&&s.vmCount++;}(t);else {const e=Tt(t._data={});e&&e.vmCount++;}n.computed&&function(t,e){const n=t._computedWatchers=Object.create(null),o=Y();for(const r in e){const s=e[r],c=i(s)?s:s.get;o||(n[r]=new fn(t,c||j,j,so)),r in t||io(t,r,s);}}(t,n.computed),n.watch&&n.watch!==J&&function(t,n){for(const o in n){const r=n[o];if(e(r))for(let e=0;e<r.length;e++)lo(t,o,r[e]);else lo(t,o,r);}}(t,n.watch);}const so={lazy:!0};function io(t,e,n){const o=!Y();i(n)?(no.get=o?co(e):ao(n),no.set=j):(no.get=n.get?o&&!1!==n.cache?co(e):ao(n.get):j,no.set=n.set||j),Object.defineProperty(t,e,no);}function co(t){return function(){const e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),dt.target&&e.depend(),e.value}}function ao(t){return function(){return t.call(this,this)}}function lo(t,e,n,o){return l(n)&&(o=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,o)}let uo=0;function fo(t){let e=t.options;if(t.super){const n=fo(t.super);if(n!==t.superOptions){t.superOptions=n;const o=function(t){let e;const n=t.options,o=t.sealedOptions;for(const t in n)n[t]!==o[t]&&(e||(e={}),e[t]=n[t]);return e}(t);o&&S(t.extendOptions,o),e=t.options=Zn(n,t.extendOptions),e.name&&(e.components[e.name]=t);}}return e}function po(t){this._init(t);}function ho(t){t.cid=0;let e=1;t.extend=function(t){t=t||{};const n=this,o=n.cid,r=t._Ctor||(t._Ctor={});if(r[o])return r[o];const s=Rn(t)||Rn(n.options),i=function(t){this._init(t);};return (i.prototype=Object.create(n.prototype)).constructor=i,i.cid=e++,i.options=Zn(n.options,t),i.super=n,i.options.props&&function(t){const e=t.options.props;for(const n in e)oo(t.prototype,"_props",n);}(i),i.options.computed&&function(t){const e=t.options.computed;for(const n in e)io(t.prototype,n,e[n]);}(i),i.extend=n.extend,i.mixin=n.mixin,i.use=n.use,N.forEach((function(t){i[t]=n[t];})),s&&(i.options.components[s]=i),i.superOptions=n.options,i.extendOptions=t,i.sealedOptions=S({},i.options),r[o]=i,i};}function mo(t){return t&&(Rn(t.Ctor.options)||t.tag)}function _o(t,n){return e(t)?t.indexOf(n)>-1:"string"==typeof t?t.split(",").indexOf(n)>-1:(o=t,"[object RegExp]"===a.call(o)&&t.test(n));var o;}function vo(t,e){const{cache:n,keys:o,_vnode:r}=t;for(const t in n){const s=n[t];if(s){const i=s.name;i&&!e(i)&&yo(n,t,o,r);}}}function yo(t,e,n,o){const r=t[e];!r||o&&r.tag===o.tag||r.componentInstance.$destroy(),t[e]=null,_(n,e);}!function(e){e.prototype._init=function(e){const n=this;n._uid=uo++,n._isVue=!0,n.__v_skip=!0,n._scope=new Gt(!0),n._scope._vm=!0,e&&e._isComponent?function(t,e){const n=t.$options=Object.create(t.constructor.options),o=e._parentVnode;n.parent=e.parent,n._parentVnode=o;const r=o.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns);}(n,e):n.$options=Zn(fo(n.constructor),e||{},n),n._renderProxy=n,n._self=n,function(t){const e=t.$options;let n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t);}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._provided=n?n._provided:Object.create(null),t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1;}(n),function(t){t._events=Object.create(null),t._hasHookEvent=!1;const e=t.$options._parentListeners;e&&mn(t,e);}(n),function(e){e._vnode=null,e._staticTrees=null;const n=e.$options,o=e.$vnode=n._parentVnode,r=o&&o.context;e.$slots=ge(n._renderChildren,r),e.$scopedSlots=o?we(e.$parent,o.data.scopedSlots,e.$slots):t,e._c=(t,n,o,r)=>Ie(e,t,n,o,r,!1),e.$createElement=(t,n,o,r)=>Ie(e,t,n,o,r,!0);const s=o&&o.data;Et(e,"$attrs",s&&s.attrs||t,null,!0),Et(e,"$listeners",n._parentListeners||t,null,!0);}(n),$n(n,"beforeCreate",void 0,!1),function(t){const e=In(t.$options.inject,t);e&&(St(!1),Object.keys(e).forEach((n=>{Et(t,n,e[n]);})),St(!0));}(n),ro(n),function(t){const e=t.$options.provide;if(e){const n=i(e)?e.call(t):e;if(!c(n))return;const o=Zt(t),r=nt?Reflect.ownKeys(n):Object.keys(n);for(let t=0;t<r.length;t++){const e=r[t];Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e));}}}(n),$n(n,"created"),n.$options.el&&n.$mount(n.$options.el);};}(po),function(t){const e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Pt,t.prototype.$delete=It,t.prototype.$watch=function(t,e,n){const o=this;if(l(e))return lo(o,t,e,n);(n=n||{}).user=!0;const r=new fn(o,t,e,n);if(n.immediate){const t=`callback for immediate watcher "${r.expression}"`;ht(),Ne(e,o,[r.value],o,t),mt();}return function(){r.teardown();}};}(po),function(t){const n=/^hook:/;t.prototype.$on=function(t,o){const r=this;if(e(t))for(let e=0,n=t.length;e<n;e++)r.$on(t[e],o);else (r._events[t]||(r._events[t]=[])).push(o),n.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){const n=this;function o(){n.$off(t,o),e.apply(n,arguments);}return o.fn=e,n.$on(t,o),n},t.prototype.$off=function(t,n){const o=this;if(!arguments.length)return o._events=Object.create(null),o;if(e(t)){for(let e=0,r=t.length;e<r;e++)o.$off(t[e],n);return o}const r=o._events[t];if(!r)return o;if(!n)return o._events[t]=null,o;let s,i=r.length;for(;i--;)if(s=r[i],s===n||s.fn===n){r.splice(i,1);break}return o},t.prototype.$emit=function(t){const e=this;let n=e._events[t];if(n){n=n.length>1?O(n):n;const o=O(arguments,1),r=`event handler for "${t}"`;for(let t=0,s=n.length;t<s;t++)Ne(n[t],e,o,e,r);}return e};}(po),function(t){t.prototype._update=function(t,e){const n=this,o=n.$el,r=n._vnode,s=vn(n);n._vnode=t,n.$el=r?n.__patch__(r,t):n.__patch__(n.$el,t,e,!1),s(),o&&(o.__vue__=null),n.$el&&(n.$el.__vue__=n);let i=n;for(;i&&i.$vnode&&i.$parent&&i.$vnode===i.$parent._vnode;)i.$parent.$el=i.$el,i=i.$parent;},t.prototype.$forceUpdate=function(){const t=this;t._watcher&&t._watcher.update();},t.prototype.$destroy=function(){const t=this;if(t._isBeingDestroyed)return;$n(t,"beforeDestroy"),t._isBeingDestroyed=!0;const e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||_(e.$children,t),t._scope.stop(),t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),$n(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null);};}(po),function(t){ye(t.prototype),t.prototype.$nextTick=function(t){return He(t,this)},t.prototype._render=function(){const t=this,{render:n,_parentVnode:o}=t.$options;let r;o&&t._isMounted&&(t.$scopedSlots=we(t.$parent,o.data.scopedSlots,t.$slots,t.$scopedSlots),t._slotsProxy&&Ae(t._slotsProxy,t.$scopedSlots)),t.$vnode=o;try{st(t),Te=t,r=n.call(t._renderProxy,t.$createElement);}catch(e){Me(e,t,"render"),r=t._vnode;}finally{Te=null,st();}return e(r)&&1===r.length&&(r=r[0]),r instanceof it||(r=ct()),r.parent=o,r};}(po);const go=[String,RegExp,Array];var bo={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:go,exclude:go,max:[String,Number]},methods:{cacheVNode(){const{cache:t,keys:e,vnodeToCache:n,keyToCache:o}=this;if(n){const{tag:r,componentInstance:s,componentOptions:i}=n;t[o]={name:mo(i),tag:r,componentInstance:s},e.push(o),this.max&&e.length>parseInt(this.max)&&yo(t,e[0],e,this._vnode),this.vnodeToCache=null;}}},created(){this.cache=Object.create(null),this.keys=[];},destroyed(){for(const t in this.cache)yo(this.cache,t,this.keys);},mounted(){this.cacheVNode(),this.$watch("include",(t=>{vo(this,(e=>_o(t,e)));})),this.$watch("exclude",(t=>{vo(this,(e=>!_o(t,e)));}));},updated(){this.cacheVNode();},render(){const t=this.$slots.default,e=Pe(t),n=e&&e.componentOptions;if(n){const t=mo(n),{include:o,exclude:r}=this;if(o&&(!t||!_o(o,t))||r&&t&&_o(r,t))return e;const{cache:s,keys:i}=this,c=null==e.key?n.Ctor.cid+(n.tag?`::${n.tag}`:""):e.key;s[c]?(e.componentInstance=s[c].componentInstance,_(i,c),i.push(c)):(this.vnodeToCache=e,this.keyToCache=c),e.data.keepAlive=!0;}return e||t&&t[0]}}};!function(t){const e={get:()=>L};Object.defineProperty(t,"config",e),t.util={warn:Vn,extend:S,mergeOptions:Zn,defineReactive:Et},t.set=Pt,t.delete=It,t.nextTick=He,t.observable=t=>(Tt(t),t),t.options=Object.create(null),N.forEach((e=>{t.options[e+"s"]=Object.create(null);})),t.options._base=t,S(t.options.components,bo),function(t){t.use=function(t){const e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;const n=O(arguments,1);return n.unshift(this),i(t.install)?t.install.apply(t,n):i(t)&&t.apply(null,n),e.push(t),this};}(t),function(t){t.mixin=function(t){return this.options=Zn(this.options,t),this};}(t),ho(t),function(t){N.forEach((e=>{t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&i(n)&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]};}));}(t);}(po),Object.defineProperty(po.prototype,"$isServer",{get:Y}),Object.defineProperty(po.prototype,"$ssrContext",{get(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(po,"FunctionalRenderContext",{value:Dn}),po.version="2.7.13";const $o=h("style,class"),wo=h("input,textarea,option,select,progress"),Co=h("contenteditable,draggable,spellcheck"),xo=h("events,caret,typing,plaintext-only"),ko=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Oo="http://www.w3.org/1999/xlink",So=t=>":"===t.charAt(5)&&"xlink"===t.slice(0,5),Ao=t=>So(t)?t.slice(6,t.length):"",jo=t=>null==t||!1===t;function To(t){let e=t.data,n=t,r=t;for(;o(r.componentInstance);)r=r.componentInstance._vnode,r&&r.data&&(e=Eo(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=Eo(e,n.data));return function(t,e){if(o(t)||o(e))return Po(t,Io(e));return ""}(e.staticClass,e.class)}function Eo(t,e){return {staticClass:Po(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Po(t,e){return t?e?t+" "+e:t:e||""}function Io(t){return Array.isArray(t)?function(t){let e,n="";for(let r=0,s=t.length;r<s;r++)o(e=Io(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):c(t)?function(t){let e="";for(const n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}const Do={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Mo=h("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),No=h("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Ro=t=>Mo(t)||No(t);const Lo=Object.create(null);const Fo=h("text,number,password,search,email,tel,url");var Uo=Object.freeze({__proto__:null,createElement:function(t,e){const n=document.createElement(t);return "select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(Do[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n);},removeChild:function(t,e){t.removeChild(e);},appendChild:function(t,e){t.appendChild(e);},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e;},setStyleScope:function(t,e){t.setAttribute(e,"");}}),Bo={create(t,e){Vo(e);},update(t,e){t.data.ref!==e.data.ref&&(Vo(t,!0),Vo(e));},destroy(t){Vo(t,!0);}};function Vo(t,n){const r=t.data.ref;if(!o(r))return;const s=t.context,c=t.componentInstance||t.elm,a=n?null:c,l=n?void 0:c;if(i(r))return void Ne(r,s,[a],s,"template ref function");const u=t.data.refInFor,f="string"==typeof r||"number"==typeof r,d=Mt(r),p=s.$refs;if(f||d)if(u){const t=f?p[r]:r.value;n?e(t)&&_(t,c):e(t)?t.includes(c)||t.push(c):f?(p[r]=[c],zo(s,r,p[r])):r.value=[c];}else if(f){if(n&&p[r]!==c)return;p[r]=l,zo(s,r,a);}else if(d){if(n&&r.value!==c)return;r.value=a;}}function zo({_setupState:t},e,n){t&&y(t,e)&&(Mt(t[e])?t[e].value=n:t[e]=n);}const Ho=new it("",{},[]),Wo=["create","activate","update","remove","destroy"];function Ko(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&o(t.data)===o(e.data)&&function(t,e){if("input"!==t.tag)return !0;let n;const r=o(n=t.data)&&o(n=n.attrs)&&n.type,s=o(n=e.data)&&o(n=n.attrs)&&n.type;return r===s||Fo(r)&&Fo(s)}(t,e)||r(t.isAsyncPlaceholder)&&n(e.asyncFactory.error))}function qo(t,e,n){let r,s;const i={};for(r=e;r<=n;++r)s=t[r].key,o(s)&&(i[s]=r);return i}var Go={create:Zo,update:Zo,destroy:function(t){Zo(t,Ho);}};function Zo(t,e){(t.data.directives||e.data.directives)&&function(t,e){const n=t===Ho,o=e===Ho,r=Xo(t.data.directives,t.context),s=Xo(e.data.directives,e.context),i=[],c=[];let a,l,u;for(a in s)l=r[a],u=s[a],l?(u.oldValue=l.value,u.oldArg=l.arg,Yo(u,"update",e,t),u.def&&u.def.componentUpdated&&c.push(u)):(Yo(u,"bind",e,t),u.def&&u.def.inserted&&i.push(u));if(i.length){const o=()=>{for(let n=0;n<i.length;n++)Yo(i[n],"inserted",e,t);};n?Yt(e,"insert",o):o();}c.length&&Yt(e,"postpatch",(()=>{for(let n=0;n<c.length;n++)Yo(c[n],"componentUpdated",e,t);}));if(!n)for(a in r)s[a]||Yo(r[a],"unbind",t,t,o);}(t,e);}const Jo=Object.create(null);function Xo(t,e){const n=Object.create(null);if(!t)return n;let o,r;for(o=0;o<t.length;o++){if(r=t[o],r.modifiers||(r.modifiers=Jo),n[Qo(r)]=r,e._setupState&&e._setupState.__sfc){const t=r.def||Jn(e,"_setupState","v-"+r.name);r.def="function"==typeof t?{bind:t,update:t}:t;}r.def=r.def||Jn(e.$options,"directives",r.name);}return n}function Qo(t){return t.rawName||`${t.name}.${Object.keys(t.modifiers||{}).join(".")}`}function Yo(t,e,n,o,r){const s=t.def&&t.def[e];if(s)try{s(n.elm,t,n,o,r);}catch(o){Me(o,n.context,`directive ${t.name} ${e} hook`);}}var tr=[Bo,Go];function er(t,e){const s=e.componentOptions;if(o(s)&&!1===s.Ctor.options.inheritAttrs)return;if(n(t.data.attrs)&&n(e.data.attrs))return;let i,c,a;const l=e.elm,u=t.data.attrs||{};let f=e.data.attrs||{};for(i in (o(f.__ob__)||r(f._v_attr_proxy))&&(f=e.data.attrs=S({},f)),f)c=f[i],a=u[i],a!==c&&nr(l,i,c,e.data.pre);for(i in (W||q)&&f.value!==u.value&&nr(l,"value",f.value),u)n(f[i])&&(So(i)?l.removeAttributeNS(Oo,Ao(i)):Co(i)||l.removeAttribute(i));}function nr(t,e,n,o){o||t.tagName.indexOf("-")>-1?or(t,e,n):ko(e)?jo(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Co(e)?t.setAttribute(e,((t,e)=>jo(e)||"false"===e?"false":"contenteditable"===t&&xo(e)?e:"true")(e,n)):So(e)?jo(n)?t.removeAttributeNS(Oo,Ao(e)):t.setAttributeNS(Oo,e,n):or(t,e,n);}function or(t,e,n){if(jo(n))t.removeAttribute(e);else {if(W&&!K&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){const e=n=>{n.stopImmediatePropagation(),t.removeEventListener("input",e);};t.addEventListener("input",e),t.__ieph=!0;}t.setAttribute(e,n);}}var rr={create:er,update:er};function sr(t,e){const r=e.elm,s=e.data,i=t.data;if(n(s.staticClass)&&n(s.class)&&(n(i)||n(i.staticClass)&&n(i.class)))return;let c=To(e);const a=r._transitionClasses;o(a)&&(c=Po(c,Io(a))),c!==r._prevClass&&(r.setAttribute("class",c),r._prevClass=c);}var ir={create:sr,update:sr};let cr;function ar(t,e,n){const o=cr;return function r(){const s=e.apply(null,arguments);null!==s&&fr(t,r,n,o);}}const lr=Fe&&!(Z&&Number(Z[1])<=53);function ur(t,e,n,o){if(lr){const t=An,n=e;e=n._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=t||e.timeStamp<=0||e.target.ownerDocument!==document)return n.apply(this,arguments)};}cr.addEventListener(t,e,Q?{capture:n,passive:o}:n);}function fr(t,e,n,o){(o||cr).removeEventListener(t,e._wrapper||e,n);}function dr(t,e){if(n(t.data.on)&&n(e.data.on))return;const r=e.data.on||{},s=t.data.on||{};cr=e.elm||t.elm,function(t){if(o(t.__r)){const e=W?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r;}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c);}(r),Qt(r,s,ur,fr,ar,e.context),cr=void 0;}var pr={create:dr,update:dr,destroy:t=>dr(t,Ho)};let hr;function mr(t,e){if(n(t.data.domProps)&&n(e.data.domProps))return;let s,i;const c=e.elm,a=t.data.domProps||{};let l=e.data.domProps||{};for(s in (o(l.__ob__)||r(l._v_attr_proxy))&&(l=e.data.domProps=S({},l)),a)s in l||(c[s]="");for(s in l){if(i=l[s],"textContent"===s||"innerHTML"===s){if(e.children&&(e.children.length=0),i===a[s])continue;1===c.childNodes.length&&c.removeChild(c.childNodes[0]);}if("value"===s&&"PROGRESS"!==c.tagName){c._value=i;const t=n(i)?"":String(i);_r(c,t)&&(c.value=t);}else if("innerHTML"===s&&No(c.tagName)&&n(c.innerHTML)){hr=hr||document.createElement("div"),hr.innerHTML=`<svg>${i}</svg>`;const t=hr.firstChild;for(;c.firstChild;)c.removeChild(c.firstChild);for(;t.firstChild;)c.appendChild(t.firstChild);}else if(i!==a[s])try{c[s]=i;}catch(t){}}}function _r(t,e){return !t.composing&&("OPTION"===t.tagName||function(t,e){let n=!0;try{n=document.activeElement!==t;}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){const n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return p(n)!==p(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var vr={create:mr,update:mr};const yr=g((function(t){const e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){const o=t.split(n);o.length>1&&(e[o[0].trim()]=o[1].trim());}})),e}));function gr(t){const e=br(t.style);return t.staticStyle?S(t.staticStyle,e):e}function br(t){return Array.isArray(t)?A(t):"string"==typeof t?yr(t):t}const $r=/^--/,wr=/\s*!important$/,Cr=(t,e,n)=>{if($r.test(e))t.style.setProperty(e,n);else if(wr.test(n))t.style.setProperty(x(e),n.replace(wr,""),"important");else {const o=Or(e);if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++)t.style[o]=n[e];else t.style[o]=n;}},xr=["Webkit","Moz","ms"];let kr;const Or=g((function(t){if(kr=kr||document.createElement("div").style,"filter"!==(t=$(t))&&t in kr)return t;const e=t.charAt(0).toUpperCase()+t.slice(1);for(let t=0;t<xr.length;t++){const n=xr[t]+e;if(n in kr)return n}}));function Sr(t,e){const r=e.data,s=t.data;if(n(r.staticStyle)&&n(r.style)&&n(s.staticStyle)&&n(s.style))return;let i,c;const a=e.elm,l=s.staticStyle,u=s.normalizedStyle||s.style||{},f=l||u,d=br(e.data.style)||{};e.data.normalizedStyle=o(d.__ob__)?S({},d):d;const p=function(t,e){const n={};let o;if(e){let e=t;for(;e.componentInstance;)e=e.componentInstance._vnode,e&&e.data&&(o=gr(e.data))&&S(n,o);}(o=gr(t.data))&&S(n,o);let r=t;for(;r=r.parent;)r.data&&(o=gr(r.data))&&S(n,o);return n}(e,!0);for(c in f)n(p[c])&&Cr(a,c,"");for(c in p)i=p[c],i!==f[c]&&Cr(a,c,null==i?"":i);}var Ar={create:Sr,update:Sr};const jr=/\s+/;function Tr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(jr).forEach((e=>t.classList.add(e))):t.classList.add(e);else {const n=` ${t.getAttribute("class")||""} `;n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim());}}function Er(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(jr).forEach((e=>t.classList.remove(e))):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else {let n=` ${t.getAttribute("class")||""} `;const o=" "+e+" ";for(;n.indexOf(o)>=0;)n=n.replace(o," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class");}}function Pr(t){if(t){if("object"==typeof t){const e={};return !1!==t.css&&S(e,Ir(t.name||"v")),S(e,t),e}return "string"==typeof t?Ir(t):void 0}}const Ir=g((t=>({enterClass:`${t}-enter`,enterToClass:`${t}-enter-to`,enterActiveClass:`${t}-enter-active`,leaveClass:`${t}-leave`,leaveToClass:`${t}-leave-to`,leaveActiveClass:`${t}-leave-active`}))),Dr=z&&!K;let Mr="transition",Nr="transitionend",Rr="animation",Lr="animationend";Dr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Mr="WebkitTransition",Nr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Rr="WebkitAnimation",Lr="webkitAnimationEnd"));const Fr=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:t=>t();function Ur(t){Fr((()=>{Fr(t);}));}function Br(t,e){const n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Tr(t,e));}function Vr(t,e){t._transitionClasses&&_(t._transitionClasses,e),Er(t,e);}function zr(t,e,n){const{type:o,timeout:r,propCount:s}=Wr(t,e);if(!o)return n();const i="transition"===o?Nr:Lr;let c=0;const a=()=>{t.removeEventListener(i,l),n();},l=e=>{e.target===t&&++c>=s&&a();};setTimeout((()=>{c<s&&a();}),r+1),t.addEventListener(i,l);}const Hr=/\b(transform|all)(,|$)/;function Wr(t,e){const n=window.getComputedStyle(t),o=(n[Mr+"Delay"]||"").split(", "),r=(n[Mr+"Duration"]||"").split(", "),s=Kr(o,r),i=(n[Rr+"Delay"]||"").split(", "),c=(n[Rr+"Duration"]||"").split(", "),a=Kr(i,c);let l,u=0,f=0;"transition"===e?s>0&&(l="transition",u=s,f=r.length):"animation"===e?a>0&&(l="animation",u=a,f=c.length):(u=Math.max(s,a),l=u>0?s>a?"transition":"animation":null,f=l?"transition"===l?r.length:c.length:0);return {type:l,timeout:u,propCount:f,hasTransform:"transition"===l&&Hr.test(n[Mr+"Property"])}}function Kr(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map(((e,n)=>qr(e)+qr(t[n]))))}function qr(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Gr(t,e){const r=t.elm;o(r._leaveCb)&&(r._leaveCb.cancelled=!0,r._leaveCb());const s=Pr(t.data.transition);if(n(s))return;if(o(r._enterCb)||1!==r.nodeType)return;const{css:a,type:l,enterClass:u,enterToClass:f,enterActiveClass:d,appearClass:h,appearToClass:m,appearActiveClass:_,beforeEnter:v,enter:y,afterEnter:g,enterCancelled:b,beforeAppear:$,appear:w,afterAppear:C,appearCancelled:x,duration:k}=s;let O=_n,S=_n.$vnode;for(;S&&S.parent;)O=S.context,S=S.parent;const A=!O._isMounted||!t.isRootInsert;if(A&&!w&&""!==w)return;const j=A&&h?h:u,T=A&&_?_:d,E=A&&m?m:f,P=A&&$||v,I=A&&i(w)?w:y,M=A&&C||g,N=A&&x||b,R=p(c(k)?k.enter:k),L=!1!==a&&!K,F=Xr(I),U=r._enterCb=D((()=>{L&&(Vr(r,E),Vr(r,T)),U.cancelled?(L&&Vr(r,j),N&&N(r)):M&&M(r),r._enterCb=null;}));t.data.show||Yt(t,"insert",(()=>{const e=r.parentNode,n=e&&e._pending&&e._pending[t.key];n&&n.tag===t.tag&&n.elm._leaveCb&&n.elm._leaveCb(),I&&I(r,U);})),P&&P(r),L&&(Br(r,j),Br(r,T),Ur((()=>{Vr(r,j),U.cancelled||(Br(r,E),F||(Jr(R)?setTimeout(U,R):zr(r,l,U)));}))),t.data.show&&(e&&e(),I&&I(r,U)),L||F||U();}function Zr(t,e){const r=t.elm;o(r._enterCb)&&(r._enterCb.cancelled=!0,r._enterCb());const s=Pr(t.data.transition);if(n(s)||1!==r.nodeType)return e();if(o(r._leaveCb))return;const{css:i,type:a,leaveClass:l,leaveToClass:u,leaveActiveClass:f,beforeLeave:d,leave:h,afterLeave:m,leaveCancelled:_,delayLeave:v,duration:y}=s,g=!1!==i&&!K,b=Xr(h),$=p(c(y)?y.leave:y),w=r._leaveCb=D((()=>{r.parentNode&&r.parentNode._pending&&(r.parentNode._pending[t.key]=null),g&&(Vr(r,u),Vr(r,f)),w.cancelled?(g&&Vr(r,l),_&&_(r)):(e(),m&&m(r)),r._leaveCb=null;}));function C(){w.cancelled||(!t.data.show&&r.parentNode&&((r.parentNode._pending||(r.parentNode._pending={}))[t.key]=t),d&&d(r),g&&(Br(r,l),Br(r,f),Ur((()=>{Vr(r,l),w.cancelled||(Br(r,u),b||(Jr($)?setTimeout(w,$):zr(r,a,w)));}))),h&&h(r,w),g||b||w());}v?v(C):C();}function Jr(t){return "number"==typeof t&&!isNaN(t)}function Xr(t){if(n(t))return !1;const e=t.fns;return o(e)?Xr(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Qr(t,e){!0!==e.data.show&&Gr(e);}const Yr=function(t){let i,c;const a={},{modules:l,nodeOps:u}=t;for(i=0;i<Wo.length;++i)for(a[Wo[i]]=[],c=0;c<l.length;++c)o(l[c][Wo[i]])&&a[Wo[i]].push(l[c][Wo[i]]);function f(t){const e=u.parentNode(t);o(e)&&u.removeChild(e,t);}function d(t,e,n,s,i,c,l){if(o(t.elm)&&o(c)&&(t=c[l]=lt(t)),t.isRootInsert=!i,function(t,e,n,s){let i=t.data;if(o(i)){const c=o(t.componentInstance)&&i.keepAlive;if(o(i=i.hook)&&o(i=i.init)&&i(t,!1),o(t.componentInstance))return p(t,e),m(n,t.elm,s),r(c)&&function(t,e,n,r){let s,i=t;for(;i.componentInstance;)if(i=i.componentInstance._vnode,o(s=i.data)&&o(s=s.transition)){for(s=0;s<a.activate.length;++s)a.activate[s](Ho,i);e.push(i);break}m(n,t.elm,r);}(t,e,n,s),!0}}(t,e,n,s))return;const f=t.data,d=t.children,h=t.tag;o(h)?(t.elm=t.ns?u.createElementNS(t.ns,h):u.createElement(h,t),g(t),_(t,d,e),o(f)&&y(t,e),m(n,t.elm,s)):r(t.isComment)?(t.elm=u.createComment(t.text),m(n,t.elm,s)):(t.elm=u.createTextNode(t.text),m(n,t.elm,s));}function p(t,e){o(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,v(t)?(y(t,e),g(t)):(Vo(t),e.push(t));}function m(t,e,n){o(t)&&(o(n)?u.parentNode(n)===t&&u.insertBefore(t,e,n):u.appendChild(t,e));}function _(t,n,o){if(e(n))for(let e=0;e<n.length;++e)d(n[e],o,t.elm,null,!0,n,e);else s(t.text)&&u.appendChild(t.elm,u.createTextNode(String(t.text)));}function v(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return o(t.tag)}function y(t,e){for(let e=0;e<a.create.length;++e)a.create[e](Ho,t);i=t.data.hook,o(i)&&(o(i.create)&&i.create(Ho,t),o(i.insert)&&e.push(t));}function g(t){let e;if(o(e=t.fnScopeId))u.setStyleScope(t.elm,e);else {let n=t;for(;n;)o(e=n.context)&&o(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e),n=n.parent;}o(e=_n)&&e!==t.context&&e!==t.fnContext&&o(e=e.$options._scopeId)&&u.setStyleScope(t.elm,e);}function b(t,e,n,o,r,s){for(;o<=r;++o)d(n[o],s,t,e,!1,n,o);}function $(t){let e,n;const r=t.data;if(o(r))for(o(e=r.hook)&&o(e=e.destroy)&&e(t),e=0;e<a.destroy.length;++e)a.destroy[e](t);if(o(e=t.children))for(n=0;n<t.children.length;++n)$(t.children[n]);}function w(t,e,n){for(;e<=n;++e){const n=t[e];o(n)&&(o(n.tag)?(C(n),$(n)):f(n.elm));}}function C(t,e){if(o(e)||o(t.data)){let n;const r=a.remove.length+1;for(o(e)?e.listeners+=r:e=function(t,e){function n(){0==--n.listeners&&f(t);}return n.listeners=e,n}(t.elm,r),o(n=t.componentInstance)&&o(n=n._vnode)&&o(n.data)&&C(n,e),n=0;n<a.remove.length;++n)a.remove[n](t,e);o(n=t.data.hook)&&o(n=n.remove)?n(t,e):e();}else f(t.elm);}function x(t,e,n,r){for(let s=n;s<r;s++){const n=e[s];if(o(n)&&Ko(t,n))return s}}function k(t,e,s,i,c,l){if(t===e)return;o(e.elm)&&o(i)&&(e=i[c]=lt(e));const f=e.elm=t.elm;if(r(t.isAsyncPlaceholder))return void(o(e.asyncFactory.resolved)?A(t.elm,e,s):e.isAsyncPlaceholder=!0);if(r(e.isStatic)&&r(t.isStatic)&&e.key===t.key&&(r(e.isCloned)||r(e.isOnce)))return void(e.componentInstance=t.componentInstance);let p;const h=e.data;o(h)&&o(p=h.hook)&&o(p=p.prepatch)&&p(t,e);const m=t.children,_=e.children;if(o(h)&&v(e)){for(p=0;p<a.update.length;++p)a.update[p](t,e);o(p=h.hook)&&o(p=p.update)&&p(t,e);}n(e.text)?o(m)&&o(_)?m!==_&&function(t,e,r,s,i){let c,a,l,f,p=0,h=0,m=e.length-1,_=e[0],v=e[m],y=r.length-1,g=r[0],$=r[y];const C=!i;for(;p<=m&&h<=y;)n(_)?_=e[++p]:n(v)?v=e[--m]:Ko(_,g)?(k(_,g,s,r,h),_=e[++p],g=r[++h]):Ko(v,$)?(k(v,$,s,r,y),v=e[--m],$=r[--y]):Ko(_,$)?(k(_,$,s,r,y),C&&u.insertBefore(t,_.elm,u.nextSibling(v.elm)),_=e[++p],$=r[--y]):Ko(v,g)?(k(v,g,s,r,h),C&&u.insertBefore(t,v.elm,_.elm),v=e[--m],g=r[++h]):(n(c)&&(c=qo(e,p,m)),a=o(g.key)?c[g.key]:x(g,e,p,m),n(a)?d(g,s,t,_.elm,!1,r,h):(l=e[a],Ko(l,g)?(k(l,g,s,r,h),e[a]=void 0,C&&u.insertBefore(t,l.elm,_.elm)):d(g,s,t,_.elm,!1,r,h)),g=r[++h]);p>m?(f=n(r[y+1])?null:r[y+1].elm,b(t,f,r,h,y,s)):h>y&&w(e,p,m);}(f,m,_,s,l):o(_)?(o(t.text)&&u.setTextContent(f,""),b(f,null,_,0,_.length-1,s)):o(m)?w(m,0,m.length-1):o(t.text)&&u.setTextContent(f,""):t.text!==e.text&&u.setTextContent(f,e.text),o(h)&&o(p=h.hook)&&o(p=p.postpatch)&&p(t,e);}function O(t,e,n){if(r(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(let t=0;t<e.length;++t)e[t].data.hook.insert(e[t]);}const S=h("attrs,class,staticClass,staticStyle,key");function A(t,e,n,s){let i;const{tag:c,data:a,children:l}=e;if(s=s||a&&a.pre,e.elm=t,r(e.isComment)&&o(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(o(a)&&(o(i=a.hook)&&o(i=i.init)&&i(e,!0),o(i=e.componentInstance)))return p(e,n),!0;if(o(c)){if(o(l))if(t.hasChildNodes())if(o(i=a)&&o(i=i.domProps)&&o(i=i.innerHTML)){if(i!==t.innerHTML)return !1}else {let e=!0,o=t.firstChild;for(let t=0;t<l.length;t++){if(!o||!A(o,l[t],n,s)){e=!1;break}o=o.nextSibling;}if(!e||o)return !1}else _(e,l,n);if(o(a)){let t=!1;for(const o in a)if(!S(o)){t=!0,y(e,n);break}!t&&a.class&&cn(a.class);}}else t.data!==e.text&&(t.data=e.text);return !0}return function(t,e,s,i){if(n(e))return void(o(t)&&$(t));let c=!1;const l=[];if(n(t))c=!0,d(e,l);else {const n=o(t.nodeType);if(!n&&Ko(t,e))k(t,e,l,null,null,i);else {if(n){if(1===t.nodeType&&t.hasAttribute("data-server-rendered")&&(t.removeAttribute("data-server-rendered"),s=!0),r(s)&&A(t,e,l))return O(e,l,!0),t;f=t,t=new it(u.tagName(f).toLowerCase(),{},[],void 0,f);}const i=t.elm,c=u.parentNode(i);if(d(e,l,i._leaveCb?null:c,u.nextSibling(i)),o(e.parent)){let t=e.parent;const n=v(e);for(;t;){for(let e=0;e<a.destroy.length;++e)a.destroy[e](t);if(t.elm=e.elm,n){for(let e=0;e<a.create.length;++e)a.create[e](Ho,t);const e=t.data.hook.insert;if(e.merged)for(let t=1;t<e.fns.length;t++)e.fns[t]();}else Vo(t);t=t.parent;}}o(c)?w([t],0,0):o(t.tag)&&$(t);}}var f;return O(e,l,c),e.elm}}({nodeOps:Uo,modules:[rr,ir,pr,vr,Ar,z?{create:Qr,activate:Qr,remove(t,e){!0!==t.data.show?Zr(t,e):e();}}:{}].concat(tr)});K&&document.addEventListener("selectionchange",(()=>{const t=document.activeElement;t&&t.vmodel&&cs(t,"input");}));const ts={inserted(t,e,n,o){"select"===n.tag?(o.elm&&!o.elm._vOptions?Yt(n,"postpatch",(()=>{ts.componentUpdated(t,e,n);})):es(t,e,n.context),t._vOptions=[].map.call(t.options,rs)):("textarea"===n.tag||Fo(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ss),t.addEventListener("compositionend",is),t.addEventListener("change",is),K&&(t.vmodel=!0)));},componentUpdated(t,e,n){if("select"===n.tag){es(t,e,n.context);const o=t._vOptions,r=t._vOptions=[].map.call(t.options,rs);if(r.some(((t,e)=>!P(t,o[e])))){(t.multiple?e.value.some((t=>os(t,r))):e.value!==e.oldValue&&os(e.value,r))&&cs(t,"change");}}}};function es(t,e,n){ns(t,e),(W||q)&&setTimeout((()=>{ns(t,e);}),0);}function ns(t,e,n){const o=e.value,r=t.multiple;if(r&&!Array.isArray(o))return;let s,i;for(let e=0,n=t.options.length;e<n;e++)if(i=t.options[e],r)s=I(o,rs(i))>-1,i.selected!==s&&(i.selected=s);else if(P(rs(i),o))return void(t.selectedIndex!==e&&(t.selectedIndex=e));r||(t.selectedIndex=-1);}function os(t,e){return e.every((e=>!P(e,t)))}function rs(t){return "_value"in t?t._value:t.value}function ss(t){t.target.composing=!0;}function is(t){t.target.composing&&(t.target.composing=!1,cs(t.target,"input"));}function cs(t,e){const n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n);}function as(t){return !t.componentInstance||t.data&&t.data.transition?t:as(t.componentInstance._vnode)}var ls={bind(t,{value:e},n){const o=(n=as(n)).data&&n.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;e&&o?(n.data.show=!0,Gr(n,(()=>{t.style.display=r;}))):t.style.display=e?r:"none";},update(t,{value:e,oldValue:n},o){if(!e==!n)return;(o=as(o)).data&&o.data.transition?(o.data.show=!0,e?Gr(o,(()=>{t.style.display=t.__vOriginalDisplay;})):Zr(o,(()=>{t.style.display="none";}))):t.style.display=e?t.__vOriginalDisplay:"none";},unbind(t,e,n,o,r){r||(t.style.display=t.__vOriginalDisplay);}},us={model:ts,show:ls};const fs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ds(t){const e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ds(Pe(e.children)):t}function ps(t){const e={},n=t.$options;for(const o in n.propsData)e[o]=t[o];const o=n._parentListeners;for(const t in o)e[$(t)]=o[t];return e}function hs(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}const ms=t=>t.tag||$e(t),_s=t=>"show"===t.name;var vs={name:"transition",props:fs,abstract:!0,render(t){let e=this.$slots.default;if(!e)return;if(e=e.filter(ms),!e.length)return;const n=this.mode,o=e[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return !0}(this.$vnode))return o;const r=ds(o);if(!r)return o;if(this._leaving)return hs(t,o);const i=`__transition-${this._uid}-`;r.key=null==r.key?r.isComment?i+"comment":i+r.tag:s(r.key)?0===String(r.key).indexOf(i)?r.key:i+r.key:r.key;const c=(r.data||(r.data={})).transition=ps(this),a=this._vnode,l=ds(a);if(r.data.directives&&r.data.directives.some(_s)&&(r.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(r,l)&&!$e(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){const e=l.data.transition=S({},c);if("out-in"===n)return this._leaving=!0,Yt(e,"afterLeave",(()=>{this._leaving=!1,this.$forceUpdate();})),hs(t,o);if("in-out"===n){if($e(r))return a;let t;const n=()=>{t();};Yt(c,"afterEnter",n),Yt(c,"enterCancelled",n),Yt(e,"delayLeave",(e=>{t=e;}));}}return o}};const ys=S({tag:String,moveClass:String},fs);delete ys.mode;var gs={props:ys,beforeMount(){const t=this._update;this._update=(e,n)=>{const o=vn(this);this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept,o(),t.call(this,e,n);};},render(t){const e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),o=this.prevChildren=this.children,r=this.$slots.default||[],s=this.children=[],i=ps(this);for(let t=0;t<r.length;t++){const e=r[t];e.tag&&null!=e.key&&0!==String(e.key).indexOf("__vlist")&&(s.push(e),n[e.key]=e,(e.data||(e.data={})).transition=i);}if(o){const r=[],s=[];for(let t=0;t<o.length;t++){const e=o[t];e.data.transition=i,e.data.pos=e.elm.getBoundingClientRect(),n[e.key]?r.push(e):s.push(e);}this.kept=t(e,null,r),this.removed=s;}return t(e,null,s)},updated(){const t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(bs),t.forEach($s),t.forEach(ws),this._reflow=document.body.offsetHeight,t.forEach((t=>{if(t.data.moved){const n=t.elm,o=n.style;Br(n,e),o.transform=o.WebkitTransform=o.transitionDuration="",n.addEventListener(Nr,n._moveCb=function t(o){o&&o.target!==n||o&&!/transform$/.test(o.propertyName)||(n.removeEventListener(Nr,t),n._moveCb=null,Vr(n,e));});}})));},methods:{hasMove(t,e){if(!Dr)return !1;if(this._hasMove)return this._hasMove;const n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((t=>{Er(n,t);})),Tr(n,e),n.style.display="none",this.$el.appendChild(n);const o=Wr(n);return this.$el.removeChild(n),this._hasMove=o.hasTransform}}};function bs(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb();}function $s(t){t.data.newPos=t.elm.getBoundingClientRect();}function ws(t){const e=t.data.pos,n=t.data.newPos,o=e.left-n.left,r=e.top-n.top;if(o||r){t.data.moved=!0;const e=t.elm.style;e.transform=e.WebkitTransform=`translate(${o}px,${r}px)`,e.transitionDuration="0s";}}var Cs={Transition:vs,TransitionGroup:gs};po.config.mustUseProp=(t,e,n)=>"value"===n&&wo(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t,po.config.isReservedTag=Ro,po.config.isReservedAttr=$o,po.config.getTagNamespace=function(t){return No(t)?"svg":"math"===t?"math":void 0},po.config.isUnknownElement=function(t){if(!z)return !0;if(Ro(t))return !1;if(t=t.toLowerCase(),null!=Lo[t])return Lo[t];const e=document.createElement(t);return t.indexOf("-")>-1?Lo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Lo[t]=/HTMLUnknownElement/.test(e.toString())},S(po.options.directives,us),S(po.options.components,Cs),po.prototype.__patch__=z?Yr:j,po.prototype.$mount=function(t,e){return function(t,e,n){let o;t.$el=e,t.$options.render||(t.$options.render=ct),$n(t,"beforeMount"),o=()=>{t._update(t._render(),n);},new fn(t,o,j,{before(){t._isMounted&&!t._isDestroyed&&$n(t,"beforeUpdate");}},!0),n=!1;const r=t._preWatchers;if(r)for(let t=0;t<r.length;t++)r[t].run();return null==t.$vnode&&(t._isMounted=!0,$n(t,"mounted")),t}(this,t=t&&z?function(t){if("string"==typeof t){return document.querySelector(t)||document.createElement("div")}return t}(t):void 0,e)},z&&setTimeout((()=>{L.devtools&&tt&&tt.emit("init",po);}),0),S(po,rn),vue_runtime_common_prod.exports=po;
  	return vue_runtime_common_prod.exports;
  }

  var hasRequiredVue_runtime_common;

  function requireVue_runtime_common () {
  	if (hasRequiredVue_runtime_common) return vue_runtime_common.exports;
  	hasRequiredVue_runtime_common = 1;
  	(function (module) {
  		{
  		  module.exports = requireVue_runtime_common_prod();
  		}
  } (vue_runtime_common));
  	return vue_runtime_common.exports;
  }

  (function (module, exports) {
  	(function webpackUniversalModuleDefinition(root, factory) {
  		module.exports = factory(require$$0, requireVue_runtime_common());
  	})(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__) {
  	return /******/ (function(modules) { // webpackBootstrap
  	/******/ 	// The module cache
  	/******/ 	var installedModules = {};
  	/******/
  	/******/ 	// The require function
  	/******/ 	function __webpack_require__(moduleId) {
  	/******/
  	/******/ 		// Check if module is in cache
  	/******/ 		if(installedModules[moduleId]) {
  	/******/ 			return installedModules[moduleId].exports;
  	/******/ 		}
  	/******/ 		// Create a new module (and put it into the cache)
  	/******/ 		var module = installedModules[moduleId] = {
  	/******/ 			i: moduleId,
  	/******/ 			l: false,
  	/******/ 			exports: {}
  	/******/ 		};
  	/******/
  	/******/ 		// Execute the module function
  	/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  	/******/
  	/******/ 		// Flag the module as loaded
  	/******/ 		module.l = true;
  	/******/
  	/******/ 		// Return the exports of the module
  	/******/ 		return module.exports;
  	/******/ 	}
  	/******/
  	/******/
  	/******/ 	// expose the modules object (__webpack_modules__)
  	/******/ 	__webpack_require__.m = modules;
  	/******/
  	/******/ 	// expose the module cache
  	/******/ 	__webpack_require__.c = installedModules;
  	/******/
  	/******/ 	// identity function for calling harmony imports with the correct context
  	/******/ 	__webpack_require__.i = function(value) { return value; };
  	/******/
  	/******/ 	// define getter function for harmony exports
  	/******/ 	__webpack_require__.d = function(exports, name, getter) {
  	/******/ 		if(!__webpack_require__.o(exports, name)) {
  	/******/ 			Object.defineProperty(exports, name, {
  	/******/ 				configurable: false,
  	/******/ 				enumerable: true,
  	/******/ 				get: getter
  	/******/ 			});
  	/******/ 		}
  	/******/ 	};
  	/******/
  	/******/ 	// getDefaultExport function for compatibility with non-harmony modules
  	/******/ 	__webpack_require__.n = function(module) {
  	/******/ 		var getter = module && module.__esModule ?
  	/******/ 			function getDefault() { return module['default']; } :
  	/******/ 			function getModuleExports() { return module; };
  	/******/ 		__webpack_require__.d(getter, 'a', getter);
  	/******/ 		return getter;
  	/******/ 	};
  	/******/
  	/******/ 	// Object.prototype.hasOwnProperty.call
  	/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  	/******/
  	/******/ 	// __webpack_public_path__
  	/******/ 	__webpack_require__.p = "";
  	/******/
  	/******/ 	// Load entry module and return exports
  	/******/ 	return __webpack_require__(__webpack_require__.s = 6);
  	/******/ })
  	/************************************************************************/
  	/******/ ([
  	/* 0 */
  	/***/ (function(module, exports) {

  	module.exports = __WEBPACK_EXTERNAL_MODULE_0__;

  	/***/ }),
  	/* 1 */
  	/***/ (function(module, __webpack_exports__, __webpack_require__) {
  	/* harmony export (immutable) */ __webpack_exports__["a"] = extend;

  	function extend() {
  	  var extended = {};
  	  var deep = false;
  	  var i = 0;
  	  var length = arguments.length;

  	  if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {
  	    deep = arguments[0];
  	    i++;
  	  }

  	  function merge(obj) {
  	    for (var prop in obj) {
  	      if (Object.prototype.hasOwnProperty.call(obj, prop)) {
  	        if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {
  	          extended[prop] = extend(true, extended[prop], obj[prop]);
  	        } else {
  	          extended[prop] = obj[prop];
  	        }
  	      }
  	    }
  	  }

  	  for (; i < length; i++) {
  	    var obj = arguments[i];
  	    merge(obj);
  	  }

  	  return extended;
  	}

  	/***/ }),
  	/* 2 */
  	/***/ (function(module, exports) {

  	module.exports = __WEBPACK_EXTERNAL_MODULE_2__;

  	/***/ }),
  	/* 3 */
  	/***/ (function(module, __webpack_exports__, __webpack_require__) {
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs__ = __webpack_require__(0);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_viewerjs__);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils__ = __webpack_require__(1);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(2);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);




  	var api = function api() {
  	  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  	      _ref$images = _ref.images,
  	      images = _ref$images === undefined ? [] : _ref$images,
  	      _ref$options = _ref.options,
  	      options = _ref$options === undefined ? {} : _ref$options;

  	  options = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils__["a" /* extend */])(options, {
  	    inline: false });

  	  var ViewerToken = __WEBPACK_IMPORTED_MODULE_2_vue___default.a.extend({
  	    render: function render(h) {
  	      return h('div', {
  	        style: {
  	          display: 'none'
  	        },
  	        class: ['__viewer-token']
  	      }, images.map(function (attr) {
  	        return h('img', {
  	          attrs: typeof attr === 'string' ? { src: attr } : attr
  	        });
  	      }));
  	    }
  	  });
  	  var token = new ViewerToken();
  	  token.$mount();
  	  document.body.appendChild(token.$el);

  	  var $viewer = new __WEBPACK_IMPORTED_MODULE_0_viewerjs___default.a(token.$el, options);
  	  var $destroy = $viewer.destroy.bind($viewer);
  	  $viewer.destroy = function () {
  	    $destroy();
  	    token.$destroy();
  	    document.body.removeChild(token.$el);
  	    return $viewer;
  	  };
  	  $viewer.show();

  	  token.$el.addEventListener('hidden', function () {
  	    if (this.viewer === $viewer) {
  	      $viewer.destroy();
  	    }
  	  });

  	  return $viewer;
  	};

  	/* harmony default export */ __webpack_exports__["a"] = (api);

  	/***/ }),
  	/* 4 */
  	/***/ (function(module, __webpack_exports__, __webpack_require__) {
  	/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs__ = __webpack_require__(0);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_viewerjs__);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_throttle_debounce__ = __webpack_require__(7);
  	/* harmony import */ __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_throttle_debounce__);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(2);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);




  	var directive = function directive() {
  	  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  	      _ref$name = _ref.name,
  	      name = _ref$name === undefined ? 'viewer' : _ref$name,
  	      _ref$debug = _ref.debug,
  	      debug = _ref$debug === undefined ? false : _ref$debug;

  	  function createViewer(el, options) {
  	    var rebuild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  	    var observer = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;

  	    __WEBPACK_IMPORTED_MODULE_2_vue___default.a.nextTick(function () {
  	      if (observer && !imageDiff(el)) return;
  	      if (rebuild || !el['$' + name]) {
  	        destroyViewer(el);
  	        el['$' + name] = new __WEBPACK_IMPORTED_MODULE_0_viewerjs___default.a(el, options);
  	        log('Viewer created');
  	      } else {
  	        el['$' + name].update();
  	        log('Viewer updated');
  	      }
  	    });
  	  }

  	  function imageDiff(el) {
  	    var imageContent = el.innerHTML.match(/<img([\w\W]+?)[\\/]?>/g);
  	    var viewerImageText = imageContent ? imageContent.join('') : undefined;
  	    if (el.__viewerImageDiffCache === viewerImageText) {
  	      log('Element change detected, but image(s) has not changed');
  	      return false;
  	    } else {
  	      log('Image change detected');
  	      el.__viewerImageDiffCache = viewerImageText;
  	      return true;
  	    }
  	  }

  	  function createObserver(el, options, debouncedCreateViewer, rebuild) {
  	    destroyObserver(el);
  	    var MutationObserver = global.MutationObserver || global.WebKitMutationObserver || global.MozMutationObserver;
  	    if (!MutationObserver) {
  	      log('Observer not supported');
  	      return;
  	    }
  	    var observer = new MutationObserver(function (mutations) {
  	      mutations.forEach(function (mutation) {
  	        log('Viewer mutation:' + mutation.type);
  	        debouncedCreateViewer(el, options, rebuild, true);
  	      });
  	    });
  	    var config = { attributes: true, childList: true, characterData: true, subtree: true };
  	    observer.observe(el, config);
  	    el.__viewerMutationObserver = observer;
  	    log('Observer created');
  	  }

  	  function createWatcher(el, _ref2, vnode, debouncedCreateViewer) {
  	    var expression = _ref2.expression;

  	    var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  	    if (!expression || !simplePathRE.test(expression)) {
  	      log('Only simple dot-delimited paths can create watcher');
  	      return;
  	    }
  	    el.__viewerUnwatch = vnode.context.$watch(expression, function (newVal, oldVal) {
  	      log('Change detected by watcher: ', expression);
  	      debouncedCreateViewer(el, newVal, true);
  	    }, {
  	      deep: true
  	    });
  	    log('Watcher created, expression: ', expression);
  	  }

  	  function destroyViewer(el) {
  	    if (!el['$' + name]) {
  	      return;
  	    }
  	    el['$' + name].destroy();
  	    delete el['$' + name];
  	    log('Viewer destroyed');
  	  }

  	  function destroyObserver(el) {
  	    if (!el.__viewerMutationObserver) {
  	      return;
  	    }
  	    el.__viewerMutationObserver.disconnect();
  	    delete el.__viewerMutationObserver;
  	    log('Observer destroyed');
  	  }

  	  function destroyWatcher(el) {
  	    if (!el.__viewerUnwatch) {
  	      return;
  	    }
  	    el.__viewerUnwatch();
  	    delete el.__viewerUnwatch;
  	    log('Watcher destroyed');
  	  }

  	  function log() {
  	    var _console;

  	    debug && (_console = console).log.apply(_console, arguments);
  	  }

  	  var directive = {
  	    bind: function bind(el, binding, vnode) {
  	      log('Viewer bind');
  	      var debouncedCreateViewer = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_throttle_debounce__["debounce"])(50, createViewer);
  	      debouncedCreateViewer(el, binding.value);

  	      createWatcher(el, binding, vnode, debouncedCreateViewer);

  	      if (!binding.modifiers.static) {
  	        createObserver(el, binding.value, debouncedCreateViewer, binding.modifiers.rebuild);
  	      }
  	    },
  	    unbind: function unbind(el, binding) {
  	      log('Viewer unbind');

  	      destroyObserver(el);

  	      destroyWatcher(el);

  	      destroyViewer(el);
  	    }
  	  };

  	  return directive;
  	};

  	/* harmony default export */ __webpack_exports__["a"] = (directive);
  	/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(9)));

  	/***/ }),
  	/* 5 */
  	/***/ (function(module, exports, __webpack_require__) {

  	var Component = __webpack_require__(10)(
  	  /* script */
  	  __webpack_require__(8),
  	  /* template */
  	  __webpack_require__(11),
  	  /* scopeId */
  	  null,
  	  /* cssModules */
  	  null
  	);
  	Component.options.__file = "/Volumes/public/Workspace/web/v-viewer/src/component.vue";
  	if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.");}
  	if (Component.options.functional) {console.error("[vue-loader] component.vue: functional components are not supported with templates, they should use render functions.");}

  	module.exports = Component.exports;


  	/***/ }),
  	/* 6 */
  	/***/ (function(module, __webpack_exports__, __webpack_require__) {
  	Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(1);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_viewerjs__ = __webpack_require__(0);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_viewerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_viewerjs__);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__component_vue__ = __webpack_require__(5);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__component_vue__);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__directive__ = __webpack_require__(4);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__api__ = __webpack_require__(3);
  	/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "component", function() { return __WEBPACK_IMPORTED_MODULE_2__component_vue___default.a; });
  	/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "directive", function() { return __WEBPACK_IMPORTED_MODULE_3__directive__["a"]; });
  	/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "api", function() { return __WEBPACK_IMPORTED_MODULE_4__api__["a"]; });
  	/* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "Viewer", function() { return __WEBPACK_IMPORTED_MODULE_1_viewerjs___default.a; });








  	/* harmony default export */ __webpack_exports__["default"] = ({
  	  install: function install(Vue) {
  	    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  	        _ref$name = _ref.name,
  	        name = _ref$name === undefined ? 'viewer' : _ref$name,
  	        _ref$debug = _ref.debug,
  	        debug = _ref$debug === undefined ? false : _ref$debug,
  	        defaultOptions = _ref.defaultOptions;

  	    __WEBPACK_IMPORTED_MODULE_1_viewerjs___default.a.setDefaults(defaultOptions);

  	    Vue.component(name, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__utils__["a" /* extend */])(__WEBPACK_IMPORTED_MODULE_2__component_vue___default.a, { name: name }));
  	    Vue.directive(name, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__directive__["a" /* default */])({ name: name, debug: debug }));
  	    Vue.prototype['$' + name + 'Api'] = __WEBPACK_IMPORTED_MODULE_4__api__["a" /* default */];
  	  },
  	  setDefaults: function setDefaults(defaultOptions) {
  	    __WEBPACK_IMPORTED_MODULE_1_viewerjs___default.a.setDefaults(defaultOptions);
  	  }
  	});

  	/***/ }),
  	/* 7 */
  	/***/ (function(module, exports, __webpack_require__) {

  	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

  	(function (global, factory) {
  		( _typeof(exports)) === 'object' && typeof module !== 'undefined' ? factory(exports) :  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  					__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  					(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  					__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) ;
  	})(this, function (exports) {

  		function throttle(delay, noTrailing, callback, debounceMode) {
  			var timeoutID;
  			var cancelled = false;

  			var lastExec = 0;

  			function clearExistingTimeout() {
  				if (timeoutID) {
  					clearTimeout(timeoutID);
  				}
  			}

  			function cancel() {
  				clearExistingTimeout();
  				cancelled = true;
  			}

  			if (typeof noTrailing !== 'boolean') {
  				debounceMode = callback;
  				callback = noTrailing;
  				noTrailing = undefined;
  			}


  			function wrapper() {
  				for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
  					arguments_[_key] = arguments[_key];
  				}

  				var self = this;
  				var elapsed = Date.now() - lastExec;

  				if (cancelled) {
  					return;
  				}

  				function exec() {
  					lastExec = Date.now();
  					callback.apply(self, arguments_);
  				}


  				function clear() {
  					timeoutID = undefined;
  				}

  				if (debounceMode && !timeoutID) {
  					exec();
  				}

  				clearExistingTimeout();

  				if (debounceMode === undefined && elapsed > delay) {
  					exec();
  				} else if (noTrailing !== true) {
  					timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
  				}
  			}

  			wrapper.cancel = cancel;

  			return wrapper;
  		}

  		function debounce(delay, atBegin, callback) {
  			return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);
  		}

  		exports.debounce = debounce;
  		exports.throttle = throttle;

  		Object.defineProperty(exports, '__esModule', { value: true });
  	});

  	/***/ }),
  	/* 8 */
  	/***/ (function(module, __webpack_exports__, __webpack_require__) {
  	Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs__ = __webpack_require__(0);
  	/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_viewerjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_viewerjs__);




  	/* harmony default export */ __webpack_exports__["default"] = ({
  	  props: {
  	    images: {
  	      type: Array
  	    },
  	    rebuild: {
  	      type: Boolean,
  	      default: false
  	    },
  	    trigger: {},
  	    options: {
  	      type: Object
  	    }
  	  },

  	  data: function data() {
  	    return {};
  	  },


  	  computed: {},

  	  methods: {
  	    onChange: function onChange() {
  	      if (this.rebuild) {
  	        this.rebuildViewer();
  	      } else {
  	        this.updateViewer();
  	      }
  	    },
  	    rebuildViewer: function rebuildViewer() {
  	      this.destroyViewer();
  	      this.createViewer();
  	    },
  	    updateViewer: function updateViewer() {
  	      if (this.$viewer) {
  	        this.$viewer.update();
  	        this.$emit('inited', this.$viewer);
  	      } else {
  	        this.createViewer();
  	      }
  	    },
  	    destroyViewer: function destroyViewer() {
  	      this.$viewer && this.$viewer.destroy();
  	    },
  	    createViewer: function createViewer() {
  	      this.$viewer = new __WEBPACK_IMPORTED_MODULE_0_viewerjs___default.a(this.$el, this.options);
  	      this.$emit('inited', this.$viewer);
  	    }
  	  },

  	  watch: {
  	    images: function images() {
  	      var _this = this;

  	      this.$nextTick(function () {
  	        _this.onChange();
  	      });
  	    },

  	    trigger: {
  	      handler: function handler() {
  	        var _this2 = this;

  	        this.$nextTick(function () {
  	          _this2.onChange();
  	        });
  	      },

  	      deep: true
  	    },
  	    options: {
  	      handler: function handler() {
  	        var _this3 = this;

  	        this.$nextTick(function () {
  	          _this3.rebuildViewer();
  	        });
  	      },

  	      deep: true
  	    }
  	  },

  	  mounted: function mounted() {
  	    this.createViewer();
  	  },
  	  destroyed: function destroyed() {
  	    this.destroyViewer();
  	  }
  	});

  	/***/ }),
  	/* 9 */
  	/***/ (function(module, exports) {

  	var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

  	var g;

  	g = function () {
  		return this;
  	}();

  	try {
  		g = g || Function("return this")() || (1, eval)("this");
  	} catch (e) {
  		if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
  	}

  	module.exports = g;

  	/***/ }),
  	/* 10 */
  	/***/ (function(module, exports) {

  	// this module is a runtime utility for cleaner component module output and will
  	// be included in the final webpack user bundle

  	module.exports = function normalizeComponent (
  	  rawScriptExports,
  	  compiledTemplate,
  	  scopeId,
  	  cssModules
  	) {
  	  var esModule;
  	  var scriptExports = rawScriptExports = rawScriptExports || {};

  	  // ES6 modules interop
  	  var type = typeof rawScriptExports.default;
  	  if (type === 'object' || type === 'function') {
  	    esModule = rawScriptExports;
  	    scriptExports = rawScriptExports.default;
  	  }

  	  // Vue.extend constructor export interop
  	  var options = typeof scriptExports === 'function'
  	    ? scriptExports.options
  	    : scriptExports;

  	  // render functions
  	  if (compiledTemplate) {
  	    options.render = compiledTemplate.render;
  	    options.staticRenderFns = compiledTemplate.staticRenderFns;
  	  }

  	  // scopedId
  	  if (scopeId) {
  	    options._scopeId = scopeId;
  	  }

  	  // inject cssModules
  	  if (cssModules) {
  	    var computed = Object.create(options.computed || null);
  	    Object.keys(cssModules).forEach(function (key) {
  	      var module = cssModules[key];
  	      computed[key] = function () { return module };
  	    });
  	    options.computed = computed;
  	  }

  	  return {
  	    esModule: esModule,
  	    exports: scriptExports,
  	    options: options
  	  }
  	};


  	/***/ }),
  	/* 11 */
  	/***/ (function(module, exports, __webpack_require__) {

  	module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  	  return _c('div', [_vm._t("default", null, {
  	    "images": _vm.images,
  	    "options": _vm.options
  	  })], 2)
  	},staticRenderFns: []};
  	module.exports.render._withStripped = true;

  	/***/ })
  	/******/ ]);
  	});
  } (vViewer));

  //

  // 富文本内容实现1:1预览
  var script = {
    name: 'RichTextPreview',
    props: {
      // 富文本内容
      html: {
        type: String
      },
      // 蒙层的背景颜色
      bg: {
        type: String
      },
      // 点击富文本，是否预览富文本中的图片
      previewImg: {
        type: Boolean,
        default: true
      },
      /**
       * 是否显示滚动条
       * @example
       * "hidden"  横向和竖向都隐藏滚动条
       * "scroll hidden" 横向滚动条展示，竖向的隐藏
       * "hidden scroll" 横向滚动条隐藏， 竖向的展示
       * "scroll" 随内容自适应
       */
      overflow: {
        type: String,
        default: 'auto'
      },

      /**
       * 溢出值； 当少数情况计算不准确，可通过这个属性设置一个较大值
       */
      coverHeight: {
        type: Number,
        default: 0
      },
      /**
       * style的字符串
       */
      cssText: {
        type: String
      },
      /**
       * 样式列表
       */
      linkList: {
        type: Array,
        default: () => []
      },

      /**
       * 默认开启原生图片懒加载
       */
      lazy: {
        type: Boolean,
        default: true
      }
    },
    data () {
      return {
        iframHeight: 'auto',
        bodyDOM: null,
        htmlDOM: null,
        show: false,

        // 定时器准确获取高度
        timer: null,
        onresizeHandler: null,

        // 取最后2次高度，如果一样，说明高度已经没有变化了-解决iframe 中 onload不触发的问题
        heightList: []
      }
    },
    watch: {
      html: {
        handler (val) {
          if (val) {
            this.show = true;

            this.$nextTick(() => {
              this.setIframeContent();
            });
          }
        },
        immediate: true
      }
    },
    mounted() {
      this.onresizeHandler = () => {
        this.heightList = [];

        this.getMaxHeight();
      };

      window.addEventListener('resize', this.onresizeHandler, false);
    },
    beforeDestroy() {
      if (this.onresizeHandler) {
        window.removeEventListener('resize',this.onresizeHandler);
      }

      if (this.timer) {
        window.clearInterval(this.timer);
      }
    },

    methods: {
      /**
       * 使用iframe实现富文本1：1预览
       */
      setIframeContent () {
        let frame = this.$refs['rich-text-preview'];

        this.bodyDOM = frame.contentDocument.querySelector('body');
        this.htmlDOM = frame.contentDocument.querySelector('html');

        this.bodyDOM.addEventListener('click', (event) => {
          if (this.previewImg) {
            this.onPreviewContent(event);
          }

          this.emitEvent(event);
        }, true);


        this.loadStyle();

        // 是否需要支持图片原生懒加载
        if (this.lazy) {
          // 创建一个临时的div
          let tempContainer = document.createElement('div');
          // 将HTML代码片段转为可操作的DOM
          tempContainer.innerHTML = this.html || '';

          let imgList = tempContainer.querySelectorAll('img');

          for (let i = 0, len = imgList.length; i < len; i++) {
            imgList[i].setAttribute('loading', 'lazy');
          }

          this.bodyDOM.appendChild(tempContainer);
        } else {
          this.bodyDOM.innerHTML = this.html || '';
        }

        const getHeightTimerHandler = () => {
          if (this.heightList.length && this.heightList.length> 2) {
            let h1 = this.heightList[this.heightList.length - 1];
            let h2 =  this.heightList[this.heightList.length - 2];

            if (h1 === h2) {
              window.clearInterval(this.timer);

              this.iframHeight = h1;
            } else {
              this.getMaxHeight();
            }
          } else {
            this.getMaxHeight();
          }
        };

        this.timer = window.setInterval(getHeightTimerHandler, 100);
      },

      /**
       * 有可能一堆的HTML中是存在 绝对定位的，则高度会存在偏差问题
       */
      getMaxHeight () {
        let bodyHeight = this.bodyDOM.offsetHeight;

        let getLastDOM = (list) => {
          let c = list[list.length - 1];

          if (c.children && c.children.length > 1) {
            return getLastDOM(c.children || [])
          } else {
            return c
          }
        };

        let lastDOM = null;

        if (this.bodyDOM.children) {
          lastDOM = getLastDOM(this.bodyDOM.children);
        }

        let h = Number.isNaN(Number(this.coverHeight)) ? 0 : this.coverHeight;

        if (lastDOM) {
          let lastDOMOffsetTop = lastDOM.offsetTop;
          const totalH = Math.max(bodyHeight, lastDOMOffsetTop) + h;

          this.heightList.push(totalH);
        } else {
          const totalH = bodyHeight + h;

          this.heightList.push(totalH);
        }
      },

      emitEvent (event) {
        this.$emit('click-dom', event);
      },

      onPreviewContent ($event) {
        if ($event.target.nodeName === 'IMG') {
          let url = $event.target.src;
          vViewer.exports.api({
            images: [url]
          });
        }
      },

      /**
       * 加载样式
       */
      loadStyle () {
        let head = this.htmlDOM.querySelector('head');
        let fragment = document.createDocumentFragment();

        this.htmlDOM.style.width = '100%';
        this.htmlDOM.style.height = '100%';
        // 父元素的高度和滚动条替代iframe的滚动条（避免去设置浏览器默认的滚动条样式）
        this.htmlDOM.style.overflow = this.overflow;

        this.bodyDOM.style.width = '100%';
        // this.bodyDOM.style.height = '100%'
        this.bodyDOM.style.margin = 0;

        if (this.linkList && this.linkList.length) {
          this.linkList.forEach(url => {
            let linkEl = document.createElement('link');

            linkEl.setAttribute('type', 'text/css');
            linkEl.setAttribute('rel', 'stylesheet');
            linkEl.setAttribute('href', url);

            fragment.appendChild(linkEl);
          });
        }

        let styleEl = document.createElement('style');

        let defaultStyle = document.createElement('style');

        // 浏览器滚动条样式
        defaultStyle.innerHTML = `
          /*纯数字换行问题*/
          body {
            word-break: break-all;
            overflow-wrap: break-word;
            -webkit-line-break: after-white-space;
          }
          /*滚动条样式*/
          ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
            background-color: #f5f5f5;
          }

          /*滚动条滑块的样式*/
          ::-webkit-scrollbar-thumb {
             border-radius: 7px;
            border: 3px solid transparent;
            background-color: #d8d8d8;
          }
        `;

        // 外部传入的自定义样式
        if (this.cssText) {
          styleEl.innerHTML = this.cssText;
        }

        fragment.appendChild(defaultStyle);
        fragment.appendChild(styleEl);

        if (head) {
          head.appendChild(fragment);
        }
      }
    }
  };

  function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
  /* server only */
  , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
    if (typeof shadowMode !== 'boolean') {
      createInjectorSSR = createInjector;
      createInjector = shadowMode;
      shadowMode = false;
    } // Vue.extend constructor export interop.


    var options = typeof script === 'function' ? script.options : script; // render functions

    if (template && template.render) {
      options.render = template.render;
      options.staticRenderFns = template.staticRenderFns;
      options._compiled = true; // functional template

      if (isFunctionalTemplate) {
        options.functional = true;
      }
    } // scopedId


    if (scopeId) {
      options._scopeId = scopeId;
    }

    var hook;

    if (moduleIdentifier) {
      // server build
      hook = function hook(context) {
        // 2.3 injection
        context = context || // cached call
        this.$vnode && this.$vnode.ssrContext || // stateful
        this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
        // 2.2 with runInNewContext: true

        if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
          context = __VUE_SSR_CONTEXT__;
        } // inject component styles


        if (style) {
          style.call(this, createInjectorSSR(context));
        } // register component module identifier for async chunk inference


        if (context && context._registeredComponents) {
          context._registeredComponents.add(moduleIdentifier);
        }
      }; // used by ssr in case component is cached and beforeCreate
      // never gets called


      options._ssrRegister = hook;
    } else if (style) {
      hook = shadowMode ? function () {
        style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
      } : function (context) {
        style.call(this, createInjector(context));
      };
    }

    if (hook) {
      if (options.functional) {
        // register for functional component in vue file
        var originalRender = options.render;

        options.render = function renderWithStyleInjection(h, context) {
          hook.call(context);
          return originalRender(h, context);
        };
      } else {
        // inject component registration as beforeCreate hook
        var existing = options.beforeCreate;
        options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
      }
    }

    return script;
  }

  var normalizeComponent_1 = normalizeComponent;

  /* script */
  const __vue_script__ = script;

  /* template */
  var __vue_render__ = function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _vm.show
      ? _c("iframe", {
          ref: "rich-text-preview",
          style: { "background-color": _vm.bg, display: "block" },
          attrs: { frameborder: "0", width: "100%", height: _vm.iframHeight },
        })
      : _vm._e()
  };
  var __vue_staticRenderFns__ = [];
  __vue_render__._withStripped = true;

    /* style */
    const __vue_inject_styles__ = undefined;
    /* scoped */
    const __vue_scope_id__ = undefined;
    /* module identifier */
    const __vue_module_identifier__ = undefined;
    /* functional template */
    const __vue_is_functional_template__ = false;
    /* style inject */
    
    /* style inject SSR */
    
    /* style inject shadow dom */
    

    
    const __vue_component__ = /*#__PURE__*/normalizeComponent_1(
      { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
      __vue_inject_styles__,
      __vue_script__,
      __vue_scope_id__,
      __vue_is_functional_template__,
      __vue_module_identifier__,
      false,
      undefined,
      undefined,
      undefined
    );

  __vue_component__.install = (Vue) => {
    Vue.component(__vue_component__.name, __vue_component__);
  };


  // umd 格式下
  if (typeof window !== 'undefined' && window.Vue) {
    __vue_component__.install(window.Vue);
  }

  return __vue_component__;

}));
